fix computing duration for each task

main
Bel LaPointe 2023-12-18 08:24:20 -07:00
parent 09e1c57f32
commit f6da50ff6f
1 changed files with 6 additions and 5 deletions

View File

@ -91,11 +91,12 @@ fn log(f: &String, enabled: &bool, since: &Option<String>) -> Result<(), String>
curr.t = x.timestamp(); curr.t = x.timestamp();
curr.d = 0.0; curr.d = 0.0;
} }
let d = match curr.xs.len() { let mut d = 1.0;
0 if x.x.len() == 0 => 0.0, if x.x.len() == 0 {
0 => 1.0, d = 0.0;
_ => ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32, } else if i > 0 {
}; d = ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32;
}
match x.x.len() { match x.x.len() {
0 => {}, 0 => {},
_ => { _ => {