tracked time total

This commit is contained in:
aaron-jack-manning
2022-08-25 09:26:33 +10:00
parent 2e85db87c1
commit 3fc3388e36
2 changed files with 19 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ pub fn time_per_tag(days : u16, vault_folder : &path::Path) -> Result<(), error:
table.set_header(vec!["Tag", "Time"]);
let mut total_duration = tasks::Duration::zero();
for (tag, duration) in times {
table.add_row(
vec![
@@ -79,8 +80,17 @@ pub fn time_per_tag(days : u16, vault_folder : &path::Path) -> Result<(), error:
duration.to_string(),
]
);
total_duration = total_duration + duration;
}
table.add_row(
vec![
String::from("Total"),
total_duration.to_string(),
]
);
println!("{}", table);
Ok(())