diff --git a/src/main.rs b/src/main.rs index 91f77a2..0c3de7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,9 +120,9 @@ fn log(f: &String, enabled: &bool, since: &Option, verbose: &bool, preci curr.d = 0.0; } let mut d = 1.0; - if curr.xs.len() == 0 { + if x.x.len() == 0 { // clock ins get duration zero d = 0.0; - } else if i > 0 { + } else if i > 0 && tsheet.xs[i].timestamp(&0) == tsheet.xs[i-1].timestamp(&0) { // if same day as previous then use elapsed as duration d = ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32; } if *verbose {