Skip to content

Commit

Permalink
restore time parse
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrib committed Mar 21, 2022
1 parent 0146d0b commit a3a1b3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ func Args(t string) (time.Duration, string, error) {
seconds := int64(math.Floor((f - floatMinutes) * 60))
minutes := int64(floatMinutes)

if seconds == 0 && len(t) > 1 {
// parse as time
d, title, err := parseTime(t)
if err == nil {
return d, title, nil
}
}

d := time.Duration(minutes)*time.Minute + time.Duration(seconds)*time.Second
title := Sprintf("%vm Timer", f)
return d, title, nil
Expand Down

0 comments on commit a3a1b3a

Please sign in to comment.