Date
dateChrono is the preset used by DefaultScheduler. Its time schema accepts valid Date objects, so convert stored strings or timestamps to Date before calling the scheduler. The current schema also rejects new Date(0) (the exact Unix epoch) and invalid dates.
Configure Date with fractionalDays at the top level of the scheduler config (default false). Direct calls require dateChrono.create({ config: { fractionalDays: false } }). With false, two times which have the same UTC date have a difference of zero, and 23:00 to 01:00 the next day gives one day. With true, that two-hour gap gives 2 / 24 days. add(from, 0.5) always adds twelve hours. Use compare for precise ordering.
How normalize participates in scheduling
Normalization maps card or revlog fields to { previous, current }. For Date and Temporal presets:
- During review,
normalizereturnsprevious: card.lastReviewAtandcurrent: card.dueAt. - Elapsed days are
difference(previous ?? current, now); New cards always use zero. - The next card stores
dueAt: add(now, interval)andlastReviewAt: now. - The revlog stores the pre-review card’s
dueAtandlastReviewAt, plus this review’sreviewTime: now. - During rollback,
normalizereturnsprevious: revlog.lastReviewAtandcurrent: revlog.dueAt. These restore the pre-review card’s timestamps; a New card restoreslastReviewAt: null.
Try the preset
Across midnight, the UTC date difference is one day; adding half a day advances the time by twelve hours.