From 3f1f822b8c6723f1f172e38da7639a2f36e5b333 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sun, 27 Mar 2022 23:17:28 +0200 Subject: [PATCH] Add mixed durations in reminder --- modules/remind/mod.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/remind/mod.go b/modules/remind/mod.go index a976662..10a0e87 100644 --- a/modules/remind/mod.go +++ b/modules/remind/mod.go @@ -254,15 +254,12 @@ func scanMixedDelay(str string) (bool, time.Time, error) { default: return true, now, fmt.Errorf("La durata ha una unità che non conosco, usa una di queste: s (secondi) m (minuti) h (ore) d (giorni)") } - return true, now.Add(dur), nil - } - /* TO FIX now = now.Add(dur) - remaining = remaining[scanned:] + nextIndex := strings.IndexRune(remaining, sep) + remaining = remaining[nextIndex+1:] } + fmt.Printf("tot: %s", now.Sub(time.Now())) return true, now, nil - */ - return false, now, nil } func parseDuration(date string, loc *time.Location) (time.Time, error) {