|
|
@ -77,3 +77,11 @@ func WithStaticDate(t time.Time) TimerOptions {
|
|
|
|
option.date = t
|
|
|
|
option.date = t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func NextDayOfWeek(date time.Time, weekDay int) time.Time {
|
|
|
|
|
|
|
|
sub := weekDay - int(date.Weekday())
|
|
|
|
|
|
|
|
if sub <= 0 {
|
|
|
|
|
|
|
|
sub += 7
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return date.Add(time.Hour * 24 * time.Duration(sub))
|
|
|
|
|
|
|
|
}
|
|
|
|