allow set base time

This commit is contained in:
兔子 2022-12-14 17:24:39 +08:00
parent 4ea575ecf2
commit 1cae9d332f

View File

@ -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 {