diff --git a/src/formatters.rs b/src/formatters.rs index cce72a3..78aa119 100644 --- a/src/formatters.rs +++ b/src/formatters.rs @@ -131,7 +131,7 @@ impl Formatter { lpad(" ", 3.max(lengths[0])), rpad("Day", 18), rpad("Start", 10), - rpad("End", 8.max(lengths[3])), + rpad("End", 10.max(lengths[3])), rpad("Duration", 8.max(lengths[4])), "Notes", )?; @@ -143,8 +143,8 @@ impl Formatter { lpad(&id, 3.max(lengths[0])), rpad(&date, 18), rpad(&start, 10), - rpad(&end, 8.max(lengths[3])), - lpad(&duration, lengths[4]), + rpad(&end, 10.max(lengths[3])), + lpad(&duration, 8.max(lengths[4])), note, )?; } @@ -154,7 +154,7 @@ impl Formatter { lpad(" ", 3.max(lengths[0])), "-".repeat(18), "-".repeat(10), - "-".repeat(8.max(lengths[3])), + "-".repeat(10.max(lengths[3])), "-".repeat(8.max(lengths[4])), "-".repeat(4.max(lengths[5])), )?; @@ -163,8 +163,8 @@ impl Formatter { lpad(" ", 3.max(lengths[0])), rpad("Total", 18), rpad("", 10), - rpad("", 8.max(lengths[3])), - rpad(&format_duration(total), 8.max(lengths[4])), + rpad("", 10.max(lengths[3])), + lpad(&format_duration(total), 8.max(lengths[4])), )?; } @@ -217,18 +217,18 @@ mod tests { let now = Utc.ymd(2008, 10, 5).and_hms(20, 0, 0); let offset = Utc; - formatter.print_formatted(entries, &mut output, now, offset).unwrap(); + formatter.print_formatted(entries, &mut output, now, offset, false).unwrap(); assert_eq!(PrettyString(&String::from_utf8_lossy(&output)), PrettyString("Timesheet: default - Day Start End Duration Notes - Fri Oct 03, 2008 12:00:00 - 14:00:00 2:00:00 entry 1 - 16:00:00 - 18:00:00 2:00:00 entry 2 - 4:00:00 - Sun Oct 05, 2008 16:00:00 - 18:00:00 2:00:00 entry 3 - 18:00:00 - 2:00:00 entry 4 - 4:00:00 - ----------------------------------------------------------- - Total 8:00:00 + Day Start End Duration Notes + Fri Oct 03, 2008 12:00:00 - 14:00:00 2:00:00 entry 1 + 16:00:00 - 18:00:00 2:00:00 entry 2 + 4:00:00 + Sun Oct 05, 2008 16:00:00 - 18:00:00 2:00:00 entry 3 + 18:00:00 - 2:00:00 entry 4 + 4:00:00 + --------------------------------------------------------- + Total 8:00:00 ")); } @@ -243,14 +243,14 @@ mod tests { let now = Utc.ymd(2008, 10, 5).and_hms(20, 0, 0); let offset = Utc; - formatter.print_formatted(entries, &mut output, now, offset).unwrap(); + formatter.print_formatted(entries, &mut output, now, offset, false).unwrap(); assert_eq!(PrettyString(&String::from_utf8_lossy(&output)), PrettyString("Timesheet: default - Day Start End Duration Notes - Fri Oct 03, 2008 12:00:00 - 14:00:00 1:59:59 entry 1 - 1:59:59 - ----------------------------------------------------------- - Total 1:59:59 + Day Start End Duration Notes + Fri Oct 03, 2008 12:00:00 - 14:00:00 1:59:59 entry 1 + 1:59:59 + --------------------------------------------------------- + Total 1:59:59 ")); } @@ -266,7 +266,7 @@ mod tests { let now = Utc.ymd(2008, 10, 5).and_hms(20, 0, 0); let offset = Utc; - formatter.print_formatted(entries, &mut output, now, offset).unwrap(); + formatter.print_formatted(entries, &mut output, now, offset, false).unwrap(); assert_eq!(PrettyString(&String::from_utf8_lossy(&output)), PrettyString("Timesheet: default Day Start End Duration Notes