CalendarDate
A calendar day with no time or zone, written 2026-10-25.
Time and calendar; ordered; since Jadpo 0.1.0.
Make one
text.parse(raw, as: CalendarDate) reads one from its text; text that isn't one at all fails malformed, such as 2026-02-30, 25/10/2026 or "".
These operations give one: temporal.add_days, temporal.add_months, temporal.add_years and temporal.date.
Text, JSON and storage
text.from writes its canonical text, the one form text.parse reads back. JSON sends its canonical text as a string.
| Text | JSON |
|---|---|
2026-02-28 |
"2026-02-28" |
2026-10-25 |
"2026-10-25" |
It is stored in one column named for the field, of type date. 2026-10-25 is stored as '2026-10-25'::date.
Shown to people
text.format(value, locale:) shows it to people in their locale. A call also gives format:.
With locale: Locale.en_gb and format: TimeFormat.date_medium:
| Value | Shown |
|---|---|
2026-02-28 |
28 Feb 2026 |
2026-10-25 |
25 Oct 2026 |
Operations
temporal.add_days(value: T, days: Int, dst: Dst?) -> T:valuemoved by whole calendar days, the clock time kept.temporal.add_months(value: T, months: Int, invalid_day: InvalidDay?, dst: Dst?) -> T:valuemoved by whole calendar months, the day and clock time kept.temporal.add_years(value: T, years: Int, invalid_day: InvalidDay?, dst: Dst?) -> T:valuemoved by whole calendar years, the day and clock time kept.temporal.date(value: ZonedTime) -> CalendarDate: A local time's date.temporal.day(value: T) -> Int: The day of the month, from 1.temporal.day_bounds(date: CalendarDate, zone: Zone) -> InstantRange: The instantsdateruns between inzone: 23, 24 or 25 hours.temporal.month(value: T) -> Int: The month, from 1 for January.temporal.month_bounds(date: CalendarDate, zone: Zone) -> InstantRange: The month holdingdateinzone.temporal.occurrences(rule: RecurrenceRule, from: T, count: Int) -> List<ZonedTime>: The nextcountoccurrences ofruleat or afterfrom, in its zone (RFC 5545): fewer when the rule ends first;countis from 1 to 1000, so an unbounded rule is never expanded without a bound. From a date, the days they fall on,List<CalendarDate>, which a rule on dates gives; from anInstant, a timed rule's local times.temporal.period_between(start: CalendarDate, end: CalendarDate) -> CalendarPeriod: Whole years, months and days fromstarttoend, sostartplus the period isend; each part negative whenendis earlier.temporal.week_bounds(date: CalendarDate, zone: Zone, starts_on: Weekday) -> InstantRange: The week holdingdateinzone, starting onstarts_on.temporal.weekday(value: T) -> Weekday: The day of the week.temporal.year(value: T) -> Int: The year of a date or of a local time's date.temporal.year_bounds(date: CalendarDate, zone: Zone) -> InstantRange: The year holdingdateinzone.
Like every standard type, it also has the contract's own operations: text.parse, text.from, text.format, json.read, json.write and ==. It is ordered, so < and sorting take it. Every standard type meets one contract says how they work.
Markdown for agents: /docs/types/type-calendar-date.md.Built from Jadpo main at e00e61f.