allow set base time

master
兔子 2 years ago
parent 4ea575ecf2
commit 1cae9d332f

@ -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 { func NextDayOfWeek(date time.Time, weekDay int) time.Time {
sub := weekDay - int(date.Weekday()) sub := weekDay - int(date.Weekday())
if sub <= 0 { if sub <= 0 {

Loading…
Cancel
Save