Add seconds config

This commit is contained in:
2026-02-02 20:57:41 +02:00
parent d1307a75b9
commit b309ccd9cd
5 changed files with 42 additions and 3 deletions

View File

@@ -132,12 +132,17 @@ var bigColonBlink = []string{
// RenderBigClock renders the current time as massive ASCII block digits.
// Format: HH:MM:SS in 24h. blinkOnMs/blinkOffMs control the colon blink cycle.
func RenderBigClock(t time.Time, blinkOnMs, blinkOffMs int) string {
func RenderBigClock(t time.Time, blinkOnMs, blinkOffMs int, showSeconds bool) string {
h := t.Hour()
m := t.Minute()
s := t.Second()
timeStr := fmt.Sprintf("%02d:%02d:%02d", h, m, s)
var timeStr string
if showSeconds {
timeStr = fmt.Sprintf("%02d:%02d:%02d", h, m, s)
} else {
timeStr = fmt.Sprintf("%02d:%02d", h, m)
}
cycle := int64(blinkOnMs + blinkOffMs)
colonVisible := t.UnixMilli()%cycle < int64(blinkOnMs)