summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2022-12-10 10:36:36 -0500
committerGordon GECOS <u@adam>2022-12-10 10:36:36 -0500
commitfc550e3de2881808016944bd0dc34059e6ecbb23 (patch)
tree5f6d6c9126f484fcf85ba5e7b711db5f0b5a77e7
parent401ea185f2f9d54d60f1ef541c71ead82e67a5e3 (diff)
countdown to show seconds left in year
-rwxr-xr-xcountdown.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/countdown.hs b/countdown.hs
index 2a1f654..a7488de 100755
--- a/countdown.hs
+++ b/countdown.hs
@@ -289,11 +289,16 @@ countdownWidget showConversion isSimulated t =
289 countdownBox = 289 countdownBox =
290 (borderWithLabel (str $ printf "Countdown %d" currentYear) $ 290 (borderWithLabel (str $ printf "Countdown %d" currentYear) $
291 vBox $ 291 vBox $
292 (str $ printf "Day %d of %d\nSecond %s of %s" 292 let secondsNow = 1 + toSeconds yearElapsed :: Int
293 dayNum 293 secondsTotal = toSeconds yearLength
294 numDays 294 in
295 (commas $ (1 + toSeconds yearElapsed :: Int)) 295 (str $ printf "Day %d of %d\nSecond %s of %s\n%s seconds remain"
296 (commas $ toSeconds yearLength)) : remains 296 dayNum
297 numDays
298 (commas secondsNow)
299 (commas secondsTotal)
300 (commas $ secondsTotal - secondsNow)
301 ) : remains
297 ) 302 )
298 remains = 303 remains =
299 [ 304 [