fix event countdowns not skipping past events

This commit is contained in:
Schrottkatze 2024-09-07 18:32:06 +02:00
parent 4f1e43e923
commit 258d4639d7
No known key found for this signature in database

View file

@ -51,6 +51,7 @@ def main [] {
let next_events = open ~/Docs/dates.csv
| update datetime {|ev| $ev.datetime | into datetime }
| sort-by datetime
| filter {|ev| ($ev.datetime > (date now))}
| first
| each {|ev| $"(ansi attr_bold)($ev.event)(ansi reset) in (ansi attr_bold)(tfmt ($ev.datetime - (date now)))s(ansi reset)" };
print $"Hi jade, you're on HRT for (ansi reset)(ansi attr_bold)((date now) - ('2024-02-18T20:53' | into datetime) | format duration month)s(ansi reset) now! | Next Event: ($next_events)";