Hyperlinkv0.8.0-beta.28

Cron

Cron.prevconsteffect/Cron.ts:785
(cron: Cron, now?: DateTime.DateTime.Input): Date

Returns the previous scheduled date/time for the given Cron instance.

When to use

Use to find the most recent occurrence of a cron schedule before a specific date/time or before the current time.

Details

When no date/time is provided, the search starts from the current time.

Gotchas

The search is strict: if the supplied date/time already matches the schedule, the result is the earlier occurrence.

gettersnext
Source effect/Cron.ts:7853 lines
export const prev = (cron: Cron, now?: DateTime.DateTime.Input): Date => {
  return stepCron(cron, now, "prev")
}