From 258d4639d7942a6e05325ca0b89b430abcb736ae Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Sat, 7 Sep 2024 18:32:06 +0200 Subject: [PATCH] fix event countdowns not skipping past events --- other/scripts/desktop/shell-startup.nu | 1 + 1 file changed, 1 insertion(+) diff --git a/other/scripts/desktop/shell-startup.nu b/other/scripts/desktop/shell-startup.nu index 8ce5547..66eb610 100644 --- a/other/scripts/desktop/shell-startup.nu +++ b/other/scripts/desktop/shell-startup.nu @@ -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)";