Add seconds config
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user