Skip to main content

Module dates

Module dates 

Source
Expand description

Dates the people store keeps (birthdays, important dates). They are machine dates the model fills: ISO 8601 YYYY-MM-DD, or --MM-DD when the year is unknown. Nothing else is read: a month name or a 05/03-style date is locale prose (May 3 or March 5?), and a wrong reading sends a reminder on the wrong day.

Constants§

DATE_FACT_CATEGORIES
The categories of person facts whose value is such a date.

Functions§

date_argument_error
Why a date argument was refused, for the model to correct.
days_until_anniversary
Days from today until the date’s next anniversary (0 today), or None when value is not an ISO date or the day does not occur this year (Feb 29 outside a leap year).
is_date_fact_category
Whether a person-fact category holds a date.
legacy_date_to_iso
A value stored before dates were ISO only, rewritten as ISO the way the old reader understood it: YYYY-M-D, numeric month first (3/15, 03-15: March 15, as the old code read them), or an English month name and a day (March 15, march 15,). None when value is already ISO or the old reader could not read it either; those stay as written.
parse_month_day
The (month, day) of an ISO date YYYY-MM-DD or a yearless --MM-DD; None for anything else.