Expand description
Dates in a site’s timezone. Ranges are computed here as epoch milliseconds so the database only ever compares integers.
The TypeScript reads local times through Intl.DateTimeFormat, which
knows ICU’s zone names. jiff reads the system’s time zone database, which
knows nearly the same ones, and the differences are settled here as the
PHP port settles them: a name is matched without regard to case, the few
that the database keeps as old fixed rules (CET, EST, MST) go to the zone
ICU reads them as, ICU’s own extra names (PST, SystemV/EST5EDT) are
added, “Factory”, which ICU refuses, is refused, and an offset such as
+05:30 is a zone, as ECMA-402 takes one.
Structs§
- Bucket
- One chart bucket.
- Range
- A span of time in a site’s timezone.
- Range
Input - What a range is asked for with: a period, or custom dates, and an interval.
Constants§
Functions§
- add_
days new Date(Date.UTC(y, m - 1, d + days)).toISOString().slice(0, 10).- add_
months - The first of the month
monthsfrom the date’s. - buckets
- Chart buckets covering a range, each starting on a local boundary and ending at the next, so only the
first and last can be partial.
resolve_rangepicks an interval that fits; a range given here with more buckets than that, such as a longer comparison, is cut off at a boundary, never merged into its last bucket. - compare_
range - The range a period is compared with: the same number of days just
before it, the same dates a year earlier, or custom dates.
Nonefor “off” or bad custom dates. - is_date
- Whether the text is a date from 1900 to 9998 that exists.
- is_
timezone - Whether
Intltakes the name as a time zone. - local_
date - The local date of an instant, YYYY-MM-DD.
- local_
weekday_ hour - The local weekday (Monday is 0) and hour of an instant.
- resolve_
range - A named period or custom dates as a range in the site’s timezone.
first_dateis the earliest local date with data, used by “all”. - start_
of - The instant a local date (and hour) begins in a zone.