Skip to content

Commit 1d113d7

Browse files
authored
Merge pull request #9 from drgrib/restore-time-parse
Restore time parsing
2 parents 0146d0b + a3a1b3a commit 1d113d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

parse/parse.go

+8
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ func Args(t string) (time.Duration, string, error) {
100100
seconds := int64(math.Floor((f - floatMinutes) * 60))
101101
minutes := int64(floatMinutes)
102102

103+
if seconds == 0 && len(t) > 1 {
104+
// parse as time
105+
d, title, err := parseTime(t)
106+
if err == nil {
107+
return d, title, nil
108+
}
109+
}
110+
103111
d := time.Duration(minutes)*time.Minute + time.Duration(seconds)*time.Second
104112
title := Sprintf("%vm Timer", f)
105113
return d, title, nil

0 commit comments

Comments
 (0)