fixed non-local time
This commit is contained in:
parent
3f7148c8ef
commit
f5fb7e1a49
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -775,7 +775,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "toru"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap",
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ impl TimeEntry {
|
||||
pub fn new(duration : Duration, date : Option<chrono::NaiveDate>, message : Option<String>) -> 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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user