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