Data & codecs5 exports
Raw Markdown/glue/date-util
Business-day calendar helpers for workdays, weekends, and nth-weekday offset calculations.
Functions & symbols#
compute-nth-weekday#
function
Computes the `Date` of the `n`th occurrence of `weekday` (1..=7) in `year` and `month`, or `()` if outside the month.
| Parameter | Type | Optional | Description |
|---|---|---|---|
year | Any | required | — |
month | Any | required | — |
weekday | Any | required | — |
n | Any | required | — |
Returns:
Anyensure-work-day-max#
function
Moves `date` backward day-by-day until reaching the latest weekday (`<= date`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Returns:
Anyensure-work-day-min#
function
Advances `date` forward day-by-day until reaching the earliest weekday (`>= date`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Returns:
Anyis-weekend-day?#
function
Returns `true` if `date` falls on a weekend (Saturday or Sunday).
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Returns:
Anyis-work-day?#
function
Returns `true` if `date` falls on a weekday (Monday through Friday).
| Parameter | Type | Optional | Description |
|---|---|---|---|
date | Any | required | — |
Returns:
Any