From f5fb7e1a4990bef709f4e8e164c84da1c9ee6bfb Mon Sep 17 00:00:00 2001 From: aaron-jack-manning Date: Fri, 23 Sep 2022 08:45:57 +1000 Subject: [PATCH] fixed non-local time --- Cargo.lock | 2 +- src/stats.rs | 2 +- src/tasks.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3fc08e7..ab2fe0d 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -775,7 +775,7 @@ dependencies = [ [[package]] name = "toru" -version = "0.5.0" +version = "0.5.1" dependencies = [ "chrono", "clap", diff --git a/src/stats.rs b/src/stats.rs index 07fc244..e3a8d30 100755 --- a/src/stats.rs +++ b/src/stats.rs @@ -42,7 +42,7 @@ pub fn time_per_tag(days : u16, vault_folder : &path::Path) -> Result<(), error: let mut time = tasks::Duration::zero(); for entry in &task.data.time_entries { - if chrono::Utc::now().naive_local().date() - entry.logged_date < chrono::Duration::days(i64::from(days)) { + if chrono::Local::now().naive_local().date() - entry.logged_date < chrono::Duration::days(i64::from(days)) { time = time + entry.duration; } } diff --git a/src/tasks.rs b/src/tasks.rs index 08e1b5d..40f3030 100755 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -215,7 +215,7 @@ impl TimeEntry { pub fn new(duration : Duration, date : Option, message : Option) -> Self { Self { - logged_date : date.unwrap_or(chrono::Utc::now().naive_local().date()), + logged_date : date.unwrap_or(chrono::Local::now().naive_local().date()), message, duration, }