Skip to content

Commit

Permalink
drop minimum last_run resolution to minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfay committed May 23, 2021
1 parent f7dd4fe commit 3a540cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,10 @@ impl<'a> Interface<'a> {

if command.last_run.is_some() {
let duration = &format_duration(
Duration::seconds(
Duration::minutes(
Utc::now()
.signed_duration_since(Utc.timestamp(command.last_run.unwrap(), 0))
.num_seconds(),
.num_minutes(),
)
.to_std()
.unwrap(),
Expand All @@ -584,8 +584,7 @@ impl<'a> Interface<'a> {
.replace("hour", "h")
.replace("minutes", "m")
.replace("minute", "m")
.replace("seconds", "s")
.replace("second", "s")
.replace("0s", "< 1m")
.to_string()
})
.collect::<Vec<String>>()
Expand Down

0 comments on commit 3a540cb

Please sign in to comment.