diff --git a/gocron.go b/gocron.go index c8d2243..1e3c845 100644 --- a/gocron.go +++ b/gocron.go @@ -193,6 +193,11 @@ func (j *Job) scheduleNextRun() { } } +// NextScheduledTime returns the time of when this job is to run next +func (j *Job) NextScheduledTime() time.Time { + return j.nextRun +} + // the follow functions set the job's unit with seconds,minutes,hours... // Set the unit with second @@ -255,18 +260,6 @@ func (j *Job) Days() *Job { return j } -/* -// Set the unit with week, which the interval is 1 -func (j *Job) Week() (job *Job) { - if j.interval != 1 { - panic("") - } - job = j.Weeks() - return -} - -*/ - // s.Every(1).Monday().Do(task) // Set the start day with Monday func (j *Job) Monday() (job *Job) {