From 76a6e78ccbea125ab5b8c06ff254260759d3140c Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 21 Jul 2020 11:24:42 +0530 Subject: switch to local time over utc time --- src/app/impl_self.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/app') diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs index 744f906..2450bff 100644 --- a/src/app/impl_self.rs +++ b/src/app/impl_self.rs @@ -118,7 +118,7 @@ impl App { } pub fn status(&self) -> StatusLine { - let today = chrono::Local::now().naive_utc().date(); + let today = chrono::Local::now().naive_local().date(); let remaining = self.habits.iter().map(|h| h.remaining(today)).sum::(); let total = self.habits.iter().map(|h| h.goal()).sum::(); let completed = total - remaining; @@ -207,7 +207,7 @@ impl App { .iter_mut() .find(|x| x.name() == name && x.is_auto()); if let Some(h) = target_habit { - h.modify(Local::now().naive_utc().date(), event); + h.modify(Local::now().naive_local().date(), event); } }; match result { -- cgit v1.2.3