From a3a1b3a3a9ff3ab243be4bef07a39846d2cc43a4 Mon Sep 17 00:00:00 2001 From: Chris Redford Date: Sun, 20 Mar 2022 19:55:55 -0700 Subject: [PATCH] restore time parse --- parse/parse.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/parse/parse.go b/parse/parse.go index a9d0cbe..b51c43a 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -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