From 1cae9d332f4a638d91fd915a403e6450ffd073ac Mon Sep 17 00:00:00 2001 From: 兔子 Date: Wed, 14 Dec 2022 17:24:39 +0800 Subject: [PATCH] allow set base time --- typed.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/typed.go b/typed.go index b47ad38..11a803e 100644 --- a/typed.go +++ b/typed.go @@ -78,6 +78,14 @@ func WithStaticDate(t time.Time) TimerOptions { } } +func NewRepeat(baseTime time.Time, unit Unit, val uint32) Repeat { + return Repeat{ + Unit: unit, + baseDate: baseTime, + Value: val, + } +} + func NextDayOfWeek(date time.Time, weekDay int) time.Time { sub := weekDay - int(date.Weekday()) if sub <= 0 {