Expand description
Calendar dates and ISO-8601 datetimes for the trust and lifecycle families (§5).
OKF v0.2 puts date-shaped fields in frontmatter and asks consumers to answer
questions about them: which verification is the most recent, and is
today >= stale_after. Two shapes occur:
- ISO-8601 datetimes in
generated.atandverified[].at(§5.2). - Plain
YYYY-MM-DDdates instale_after(§5.5),sources[].last_modified, andusage_window(§5.1).
Answering those needs real date arithmetic, so this module implements the
small amount required on the standard library alone: a proleptic Gregorian
Date, an offset-aware DateTime that orders correctly across time
zones, and the DateField / DateTimeField wrappers that keep the raw
scalar around so a validator can report what failed to parse.
Structs§
- Date
- A proleptic-Gregorian calendar date (
YYYY-MM-DD). - Date
Field - A frontmatter date field: the scalar exactly as written, plus its parse.
- Date
Time - An ISO-8601 datetime: a
Date, an optional time of day, and an optional UTC offset. - Date
Time Field - A frontmatter datetime field: the scalar exactly as written, plus its parse.
- Parse
Date Error - Error returned when a string is not a valid date or datetime.