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]]
|
[[package]]
|
||||||
name = "toru"
|
name = "toru"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -42,7 +42,7 @@ pub fn time_per_tag(days : u16, vault_folder : &path::Path) -> Result<(), error:
|
|||||||
let mut time = tasks::Duration::zero();
|
let mut time = tasks::Duration::zero();
|
||||||
|
|
||||||
for entry in &task.data.time_entries {
|
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;
|
time = time + entry.duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ impl TimeEntry {
|
|||||||
pub fn new(duration : Duration, date : Option<chrono::NaiveDate>, message : Option<String>) -> Self {
|
pub fn new(duration : Duration, date : Option<chrono::NaiveDate>, message : Option<String>) -> Self {
|
||||||
|
|
||||||
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,
|
message,
|
||||||
duration,
|
duration,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user