Liking cljdoc? Tell your friends :D

baredom.components.x-calendar.model

Pure model layer for x-calendar. No DOM, no side effects — every function is a value transform. Dates flow as ISO "YYYY-MM-DD" strings; the canonical model holds only value-comparable data (strings, keywords, numbers, sets) so the render change-guard can compare it with not=. UTC date math lives in baredom.utils.dates.

Pure model layer for x-calendar. No DOM, no side effects — every
function is a value transform. Dates flow as ISO "YYYY-MM-DD" strings;
the canonical model holds only value-comparable data (strings, keywords,
numbers, sets) so the render change-guard can compare it with `not=`.
UTC date math lives in baredom.utils.dates.
raw docstring

attr-auto-swapcljs

source

attr-disabledcljs

source

attr-disabled-datescljs

source

attr-endcljs

source

attr-first-day-of-weekcljs

source

attr-localecljs

source

attr-maxcljs

source

attr-mincljs

source

attr-modecljs

source

attr-monthcljs

source

attr-range-allow-samecljs

source

attr-show-week-numberscljs

source

attr-startcljs

source

attr-valuecljs

source

canonicalizecljs

(canonicalize {:keys [mode value start end min max disabled-dates
                      first-day-of-week locale month-raw disabled?
                      show-week-numbers? range-allow-same-day? auto-swap?
                      today]})

Build the stable, value-comparable model from raw attribute strings. today is a JS Date supplied by the caller. The returned map holds only strings/keywords/numbers/sets so the render change-guard can compare it.

Build the stable, value-comparable model from raw attribute strings.
`today` is a JS Date supplied by the caller. The returned map holds only
strings/keywords/numbers/sets so the render change-guard can compare it.
sourceraw docstring

compute-cell-flagscljs

(compute-cell-flags {:keys [mode value start end min max disabled-set]}
                    cell-iso
                    in-month?
                    today-iso)

Derive the display flags for a single calendar day cell. model is the canonicalized map, cell-iso the cell's ISO date, in-month? whether it belongs to the displayed month, and today-iso today's ISO date. All output booleans are explicitly coerced.

Derive the display flags for a single calendar day cell.
`model` is the canonicalized map, `cell-iso` the cell's ISO date,
`in-month?` whether it belongs to the displayed month, and `today-iso`
today's ISO date. All output booleans are explicitly coerced.
sourceraw docstring

date->year-monthcljs

(date->year-month d)

JS Date → "YYYY-MM" (the month attribute format).

JS Date → "YYYY-MM" (the `month` attribute format).
sourceraw docstring

displayed-monthcljs

(displayed-month {:keys [month-raw value-d start-d today]})

Resolve which month the grid shows, as a UTC Date on the 1st. Priority: explicit month attr → month of the selected value/start → today. today must be supplied by the caller (keeps this pure).

Resolve which month the grid shows, as a UTC Date on the 1st.
Priority: explicit `month` attr → month of the selected value/start →
`today`. `today` must be supplied by the caller (keeps this pure).
sourceraw docstring

event-changecljs

source

event-navigatecljs

source

event-schemacljs

source

method-apicljs

source

month-labelcljs

(month-label d locale)

Localized "<Month> <Year>" label for a UTC month Date.

Localized "<Month> <Year>" label for a UTC month Date.
sourceraw docstring

month-optionscljs

(month-options locale)

Twelve {:index 0-11 :label "<Month>"} entries for the quick-jump panel, localized.

Twelve {:index 0-11 :label "<Month>"} entries for the quick-jump panel,
localized.
sourceraw docstring

observed-attributescljs

source

parse-disabled-datescljs

(parse-disabled-dates s)

Parse a space/comma-separated list of ISO dates into a set of ISO strings. Entries that are not valid ISO dates are dropped.

Parse a space/comma-separated list of ISO dates into a set of ISO
strings. Entries that are not valid ISO dates are dropped.
sourceraw docstring

parse-first-dowcljs

(parse-first-dow s)

Parse the first-day-of-week attribute. Accepts a digit 0-6 or a weekday word (case-insensitive). Returns 0 (Sunday) for anything unrecognised.

Parse the first-day-of-week attribute. Accepts a digit 0-6 or a weekday
word (case-insensitive). Returns 0 (Sunday) for anything unrecognised.
sourceraw docstring

parse-modecljs

(parse-mode s)

Returns :single or :range. Default is :single.

Returns :single or :range. Default is :single.
sourceraw docstring

parse-year-monthcljs

(parse-year-month s)

Parse a "YYYY-MM" (or full "YYYY-MM-DD") string to a UTC Date at the 1st of that month, or nil.

Parse a "YYYY-MM" (or full "YYYY-MM-DD") string to a UTC Date at the
1st of that month, or nil.
sourceraw docstring

property-apicljs

source

safe-localecljs

(safe-locale s)

Normalize a raw locale attribute and return it only when it is a tag Intl.DateTimeFormat accepts; otherwise nil so callers fall back to the runtime default. Guards every Intl call site from a RangeError that would otherwise crash the render.

Normalize a raw `locale` attribute and return it only when it is a tag
`Intl.DateTimeFormat` accepts; otherwise nil so callers fall back to the
runtime default. Guards every Intl call site from a RangeError that would
otherwise crash the render.
sourceraw docstring

tag-namecljs

source

weekday-namescljs

(weekday-names locale fdow)

Seven short weekday labels, localized, starting at fdow (0=Sunday..6=Saturday).

Seven short weekday labels, localized, starting at `fdow`
(0=Sunday..6=Saturday).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close