(add-days d n)Return a new Date that is d + n days (UTC).
Return a new Date that is d + n days (UTC).
(canonicalize {:keys [mode value start end min max format locale separator
auto-swap? range-allow-same-day?]})Build stable model from raw attr strings.
Build stable model from raw attr strings.
(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.
(display-value canon {:keys [format locale]})Compute the input display string from canonicalized state.
Compute the input display string from canonicalized state.
(format-date d {:keys [format locale]})Format a JS Date for display. Uses Intl.DateTimeFormat when available.
Format a JS Date for display. Uses Intl.DateTimeFormat when available.
(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.
(max-date a b)(min-date a b)(month-grid d)Return a 42-item vector for a calendar view of the month containing d. Each entry is {:date jsDate :in-month? boolean}.
Return a 42-item vector for a calendar view of the month containing d.
Each entry is {:date jsDate :in-month? boolean}.(normalize-str s)Trim and return nil if empty.
Trim and return nil if empty.
(parse-bool-attr s)Returns true if attr string is non-nil and not "false".
Returns true if attr string is non-nil and not "false".
(parse-display->range display {:keys [separator]})Try to parse a display string that may contain a separator. Returns {:ok? boolean :start js/Date|nil :end js/Date|nil}.
Try to parse a display string that may contain a separator.
Returns {:ok? boolean :start js/Date|nil :end js/Date|nil}.(parse-display->single display)Try to parse a display string to a single date. Accepts ISO "YYYY-MM-DD". Returns {:ok? boolean :date js/Date|nil}.
Try to parse a display string to a single date.
Accepts ISO "YYYY-MM-DD". Returns {:ok? boolean :date js/Date|nil}.(parse-format s)Returns :iso or :localized. Default is :iso.
Returns :iso or :localized. Default is :iso.
(parse-int s default-v)Parse integer string, returning default-v on failure.
Parse integer string, returning default-v on failure.
(parse-mode s)Returns :single or :range. Default is :single.
Returns :single or :range. Default is :single.
(start-of-month d)Return UTC midnight on the 1st of d's month.
Return UTC midnight on the 1st of d's month.
(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 |