allow set base time
This commit is contained in:
parent
4ea575ecf2
commit
1cae9d332f
8
typed.go
8
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user