(t time.Time)
| 58 | type Option func(task *SchedulerTask) error |
| 59 | |
| 60 | func WithTime(t time.Time) Option { |
| 61 | return func(task *SchedulerTask) error { |
| 62 | task.startTime = time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), 0, time.Local) |
| 63 | |
| 64 | if t.Location() != nil && t.Location() != time.Local { |
| 65 | task.location = t.Location() |
| 66 | } |
| 67 | |
| 68 | return nil |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // Deprecated: Use WithTime instead. |
| 73 | func WithStartTime(year int, month time.Month, day, hour, min, sec int) Option { |
no outgoing calls