Pure UTC date primitives shared by date components (x-date-picker,
x-calendar). No DOM, no side effects — every function is a value
transform. Dates are JS Date objects pinned to UTC midnight; ISO
strings are "YYYY-MM-DD".
first-day-of-week (fdow) is 0=Sunday .. 6=Saturday. The
start-of-week / end-of-week / month-grid functions default to
0 (Sunday) so existing single-arity callers keep their behaviour.
Pure UTC date primitives shared by date components (x-date-picker, x-calendar). No DOM, no side effects — every function is a value transform. Dates are JS `Date` objects pinned to UTC midnight; ISO strings are `"YYYY-MM-DD"`. `first-day-of-week` (`fdow`) is `0`=Sunday .. `6`=Saturday. The `start-of-week` / `end-of-week` / `month-grid` functions default to `0` (Sunday) so existing single-arity callers keep their behaviour.
(add-days d n)Return a new Date that is d + n days (UTC).
Return a new Date that is d + n days (UTC).
(add-months d n)Return a new Date that is d +/- n months (UTC). Clamps day to target month's last day when overflow would occur (e.g. Jan 31 + 1 → Feb 28).
Return a new Date that is d +/- n months (UTC). Clamps day to target month's last day when overflow would occur (e.g. Jan 31 + 1 → Feb 28).
(clamp-to-range d min-d max-d)Clamp d to [min-d, max-d]. Either bound may be nil (unbounded).
Clamp d to [min-d, max-d]. Either bound may be nil (unbounded).
(compare-date a b)Returns -1, 0, or 1 comparing two UTC dates by day only.
Returns -1, 0, or 1 comparing two UTC dates by day only.
(date->iso d)JS Date → "YYYY-MM-DD" using UTC fields.
JS Date → "YYYY-MM-DD" using UTC fields.
(days-in-month d)Number of days in d's UTC month.
Number of days in d's UTC month.
(end-of-week d)(end-of-week d fdow)Return the last day of d's week (UTC), 6 days after start-of-week.
fdow defaults to 0 (Sunday → Saturday).
Return the last day of d's week (UTC), 6 days after `start-of-week`. `fdow` defaults to 0 (Sunday → Saturday).
(in-range? d a b)True if d is between a and b inclusive (either order).
True if d is between a and b inclusive (either order).
(iso->date s)"YYYY-MM-DD" → JS Date at UTC midnight, or nil on parse failure.
"YYYY-MM-DD" → JS Date at UTC midnight, or nil on parse failure.
(iso-week-number d)ISO-8601 week number (1-53) for d's UTC date. Weeks start Monday; week 1 is the week containing the first Thursday of the year.
ISO-8601 week number (1-53) for d's UTC date. Weeks start Monday; week 1 is the week containing the first Thursday of the year.
(month-grid d)(month-grid d fdow)Return a 42-item vector for a calendar view of the month containing d.
Each entry is {:date jsDate :in-month? boolean}. fdow is the first
day of the week (0=Sunday..6=Saturday); defaults to 0 (Sunday).
Return a 42-item vector for a calendar view of the month containing d.
Each entry is {:date jsDate :in-month? boolean}. `fdow` is the first
day of the week (0=Sunday..6=Saturday); defaults to 0 (Sunday).(start-of-month d)Return UTC midnight on the 1st of d's month.
Return UTC midnight on the 1st of d's month.
(start-of-week d)(start-of-week d fdow)Return the start of d's week (UTC). fdow is the first day of the week
(0=Sunday..6=Saturday); defaults to 0 (Sunday).
Return the start of d's week (UTC). `fdow` is the first day of the week (0=Sunday..6=Saturday); defaults to 0 (Sunday).
(weekday-0-sun d)Day of week 0=Sunday..6=Saturday for d's UTC date.
Day of week 0=Sunday..6=Saturday for d's UTC date.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |