@@ 52,10 52,13 @@ fn is_soon(td: TimeDelta) -> bool { td <= TimeDelta::hours(6) }
fn is_ending_imminent(td: TimeDelta) -> bool { td <= TimeDelta::minutes(30) }
fn format_time_delta(td: TimeDelta) -> String {
- if td.num_hours() == 0 {
- format!("{}m", td.num_minutes())
+ let total_mins = (td.num_seconds() + 59) / 60;
+ let hours = total_mins / 60;
+ let mins = total_mins % 60;
+ if hours == 0 {
+ format!("{}m", mins)
} else {
- format!("{}h{}m", td.num_hours(), td.num_minutes() % 60)
+ format!("{}h{}m", hours, mins)
}
}