From a49a42f150ba6a978fe72d8ecd66c8b46cbb1677 Mon Sep 17 00:00:00 2001 From: core Date: Sat, 21 Mar 2026 20:20:30 -0400 Subject: [PATCH] improvements --- README.md | 34 ++++++++++++++++++++++++++++++++++ src/main.rs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2e84de1b4e83ad66aadabbb8f080aa953061625e --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# calstr +dead simple calendar summary for bars + +``` +nothing left today +nothing left today, some event at 00:15 tomorrow +some event at 13:15 +some event in 1h7m +some event in 1h7m in room 204 +in Board meeting until 03:00 +Board meeting ends in 15m +Board meeting (Room 217) ends in 10m, then Followup meeting in 5m in Room 218 +Board meeting ends in 10m, then End-of-day meeting at 16:50 +``` + +## usage +calstr works on a local vdir calendar. synchronize your caldav, google calendar, icloud calendar, etc to a local directory using https://pimsync.whynothugo.nl/ or https://github.com/pimutils/vdirsyncer. + +then: +``` +$ calstr /path/to/your/vdir +nothing left today, AA 417 at 00:15 tomororw +``` + +that's it! +optionally, add a second argument `withloc` to include locations when available + +``` +$ calstr /path/to/your/vdir withloc +in Caclulus II (M3304) until 12:20 +``` + +## customization +the code's right there \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index b84d77e855283b9d3720a373a04514d6094c78fa..57608ed89653cf70693f771a1bb0313af6f55ad1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -128,7 +128,7 @@ fn main() { let now = Utc::now(); - let mut midnight = Utc::now().with_time(NaiveTime::from_hms_milli_opt(0, 0, 0, 0).unwrap()).unwrap(); + let mut midnight = Local::now().with_time(NaiveTime::from_hms_milli_opt(0, 0, 0, 0).unwrap()).unwrap(); midnight += TimeDelta::days(1); let time_until_next = next.0 - now;