diff options
author | Andrew Cady <d@cryptonomic.net> | 2022-09-22 00:29:03 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2022-09-22 00:39:28 -0400 |
commit | 563497c8b6f194415faf5cb0e97040cc1db0695c (patch) | |
tree | 9e9df9dd0cfe8dc3d7403fd770998dacde912407 | |
parent | eb4522fbc1487b6bdaff379aa18d3530876b2581 (diff) |
fix "cosmic time ago" display (partially)
-rwxr-xr-x | countdown.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/countdown.hs b/countdown.hs index b64b685..0d072e1 100755 --- a/countdown.hs +++ b/countdown.hs | |||
@@ -264,14 +264,19 @@ countdownWidget showConversion isSimulated t = | |||
264 | hCenter $ txt calSubtitle, | 264 | hCenter $ txt calSubtitle, |
265 | str "\n", | 265 | str "\n", |
266 | hBox [ | 266 | hBox [ |
267 | str $ formatTime defaultTimeLocale "%A, %B %e%n%Y-%m-%d %r" $ calBeginTime `addLocalTime` yearStart t, | 267 | let cosmicSecondsAgo = nominalDiffTimeToSeconds (yearEnd cosmicCalendarT `diffLocalTime` cosmicCalendarT) |
268 | cosmicCalendarT = calBeginTime `addLocalTime` yearStart t | ||
269 | in vBox [ | ||
270 | str $ formatTime defaultTimeLocale "%A, %B %e%n%Y-%m-%d %r" $ cosmicCalendarT, | ||
271 | -- TODO: Choose correct cosmic unit | ||
272 | str $ printf "%s cosmic second%s ago" (commasF' 1 cosmicSecondsAgo) (pluralize cosmicSecondsAgo) | ||
273 | ], | ||
268 | padLeft Max $ vBox [ | 274 | padLeft Max $ vBox [ |
269 | str $ showLarge years ++ " years", | 275 | str $ showLarge years ++ " years", |
270 | str $ printf "%s years ago" $ showLarge $ realToFrac (ageOfUniverseInYears - floor years) | 276 | str $ printf "%s years ago" $ showLarge $ realToFrac (ageOfUniverseInYears - floor years) |
271 | ] | 277 | ] |
272 | ], | 278 | ], |
273 | -- str $ printf "%s years ago" (commas $ ageOfUniverseInYears - floor years), | 279 | -- str $ printf "%s years ago" (commas $ ageOfUniverseInYears - floor years), |
274 | str $ printf "%s years ago" $ showLarge $ realToFrac (ageOfUniverseInYears - floor years), | ||
275 | if not short | 280 | if not short |
276 | then | 281 | then |
277 | str "\n" <=> | 282 | str "\n" <=> |