diff options
author | Andrew Cady <d@cryptonomic.net> | 2022-09-16 23:00:29 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2022-09-16 23:00:29 -0400 |
commit | 0c809ee14c9acb07c927f1057c02bc0a91558034 (patch) | |
tree | 139d67fdbeb71f3d90409cf0631d1a644b20853b | |
parent | c9730296d17d63e6f92e7b863b3301c6f15d5f03 (diff) |
more output tweaking
-rwxr-xr-x | countdown.hs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/countdown.hs b/countdown.hs index 419a7c8..d630287 100755 --- a/countdown.hs +++ b/countdown.hs | |||
@@ -215,8 +215,10 @@ countdownWidget isSimulated t = | |||
215 | borderWithLabel (str "Cosmic Conversion") (hBox [cosmicConversion, cosmicConversion']) | 215 | borderWithLabel (str "Cosmic Conversion") (hBox [cosmicConversion, cosmicConversion']) |
216 | ]) | 216 | ]) |
217 | where | 217 | where |
218 | cosmicCalendarPrevious = borderWithLabel (str "Last on the Cosmic Calendar") $ (str " ") <=> prevEntry | 218 | cosmicCalendarPrevious = borderWithLabel (str "Previously on the Cosmic Calendar") prevEntry |
219 | cosmicCalendarNext = borderWithLabel (str "Next on the Cosmic Calendar") $ (str " ") <=> nextEntry | 219 | cosmicCalendarNext = borderWithLabel (str $ (if current then "Now" else "Next") ++ " on the Cosmic Calendar") nextEntry |
220 | where | ||
221 | current = True | ||
220 | 222 | ||
221 | -- TODO: We want to display "today" or "now" on the cosmic calendar; | 223 | -- TODO: We want to display "today" or "now" on the cosmic calendar; |
222 | -- We want to display what happened previously on the cosmic calendar | 224 | -- We want to display what happened previously on the cosmic calendar |
@@ -242,9 +244,15 @@ countdownWidget isSimulated t = | |||
242 | box = borderWithLabel (txt calTitle) $ vBox [ | 244 | box = borderWithLabel (txt calTitle) $ vBox [ |
243 | hCenter $ txt $ calSubtitle, | 245 | hCenter $ txt $ calSubtitle, |
244 | str "\n", | 246 | str "\n", |
245 | str $ show $ calBeginTime `addLocalTime` yearStart t, | 247 | hBox [ |
246 | str $ showLarge years ++ " years", | 248 | str $ formatTime defaultTimeLocale "%A, %B %e%n%Y-%m-%d %r" $ calBeginTime `addLocalTime` yearStart t, |
247 | str $ printf "%s years ago" (commas $ ageOfUniverseInYears - floor years), | 249 | padLeft Max $ vBox [ |
250 | str $ showLarge years ++ " years", | ||
251 | str $ printf "%s years ago" $ showLarge $ realToFrac (ageOfUniverseInYears - floor years) | ||
252 | ] | ||
253 | ], | ||
254 | -- str $ printf "%s years ago" (commas $ ageOfUniverseInYears - floor years), | ||
255 | str $ printf "%s years ago" $ showLarge $ realToFrac (ageOfUniverseInYears - floor years), | ||
248 | str "\n", | 256 | str "\n", |
249 | txtWrap calDescription | 257 | txtWrap calDescription |
250 | ] | 258 | ] |