(anchor canon)The date that canon names: the value in single mode, the start in range mode.
The date that `canon` names: the value in single mode, the start in range mode.
(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.
(committed-value? canon)True when the canonicalized model holds at least one committed date.
True when the canonicalized model holds at least one committed date.
(day-flags d {:keys [mode value-d start-d end-d]})What the selection of canon makes of the Date d: selected, in the range, an edge of it.
What the selection of `canon` makes of the Date `d`: selected, in the range, an edge of it.
(day-out-of-range? d canon)True when the Date d is before the minimum or after the maximum of canon.
True when the Date `d` is before the minimum or after the maximum of `canon`.
(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.
(mode-name canon)The name of the mode of canon.
The name of the mode of `canon`.
(normalize-str s)Trim and return nil if empty.
Trim and return nil if empty.
(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.
(range-pick {:keys [start-d auto-swap? allow-same-day?] :as canon} d)The range that a click on day d asks for, as ISO text in :start and :end.
:end is nil when the click starts a range.
The range that a click on day `d` asks for, as ISO text in `:start` and `:end`. `:end` is nil when the click starts a range.
(shown-days month canon focus-iso)What each of the 42 cells of the day grid shows for the month of the Date month, or none
with no month. Only one cell can be reached by Tab, see tab-iso.
What each of the 42 cells of the day grid shows for the month of the Date `month`, or none with no month. Only one cell can be reached by Tab, see `tab-iso`.
(shown-month old-canon canon month today)The first day of the month the calendar shows: the month of the date of canon when that
date changes from old-canon, else month, else the month of that date or of today.
The first day of the month the calendar shows: the month of the date of `canon` when that date changes from `old-canon`, else `month`, else the month of that date or of `today`.
(write-display? focused? text written)True when the input gets text: it has no focus, or text differs from written,
the text last written.
True when the input gets `text`: it has no focus, or `text` differs from `written`, the text last written.
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 |