/calendar/gregorian
Pure Gregorian calendar arithmetic: leap years, days in month, weekday indices, and date comparison.
Functions & symbols#
add-days#
Shifts a Gregorian date by whole days.
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
day-offset | Any | required | — |
Anyadd-months#
Shifts a Gregorian date map by a whole number of months.
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
month-offset | Any | required | — |
Anyadd-months-to-year-month#
Shifts a year-month pair by whole months.
| Parameter | Type | Optional | Description |
|---|---|---|---|
year | Any | required | — |
month | Any | required | — |
month-offset | Any | required | — |
Anycompare-dates#
Compares two Gregorian dates.
| Parameter | Type | Optional | Description |
|---|---|---|---|
left | Any | required | — |
right | Any | required | — |
Anycompute-weekday-index#
Returns the weekday index for a Gregorian date using Sunday as zero.
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Anyconstruct-date#
Constructs a valid Gregorian date map.
| Parameter | Type | Optional | Description |
|---|---|---|---|
year | Any | required | — |
month | Any | required | — |
day | Any | required | — |
Anyconstruct-today-date#
Returns the current local Gregorian date.
Anydate-from-epoch-days#
Converts an epoch day count into a Gregorian date.
| Parameter | Type | Optional | Description |
|---|---|---|---|
epoch-days | Any | required | — |
Anydate-from-iso-text#
Parses an ISO date string into a Gregorian date map.
| Parameter | Type | Optional | Description |
|---|---|---|---|
text | Any | required | — |
Anydays-in-month#
Returns the number of days in a Gregorian month.
| Parameter | Type | Optional | Description |
|---|---|---|---|
year | Any | required | — |
month | Any | required | — |
Anyepoch-days-from-date#
Converts a Gregorian date into an epoch day count.
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Anyis-leap-year?#
Returns true when the year uses the Gregorian leap-year rules.
| Parameter | Type | Optional | Description |
|---|---|---|---|
year | Any | required | — |
Anyis-same-date?#
Returns true when two Gregorian dates match exactly.
| Parameter | Type | Optional | Description |
|---|---|---|---|
left | Any | required | — |
right | Any | required | — |
Anyiso-text-from-date#
Formats a Gregorian date as YYYY-MM-DD.
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Any