Skip to content

Methods and properties ​

Static ​

MemberDescription
FlowDatepicker.init(root?, options?)starts every data-flow-datepicker inside root (default document) and returns the pickers
FlowDatepicker.get(target)the picker of an element or selector, or null
FlowDatepicker.destroy(root?)destroys every picker inside root
FlowDatepicker.autoInit(options?)the automatic start used by the script build; { root, htmx }
FlowDatepicker.use(plugin, options?)runs a plugin once
FlowDatepicker.modes, .views, .triggersregistries, each with register and get
FlowDatepicker.defaultsdefault options
FlowDatepicker.selectorthe selector init uses
new FlowDatepicker(target, options?)starts one element (or returns its picker)

Instance ​

MemberDescription
getValue()the value, see below
setValue(value, { silent })sets the value and fires change unless silent
valueget or set, same as the two above
clear({ silent })empties the value
open(), close({ restoreFocus }), toggle()the popover
isOpentrue while open
focus()focuses the trigger
refresh()reads the native inputs again after you changed them in code
setOptions(patch)changes options, labels and language
destroy({ restore })removes the picker; restore: false leaves the native input hidden
disabledtrue when the native input is disabled
element, mode, options, labels, localeread only

Values ​

ModegetValue() returnssetValue() accepts
Date'2026-10-12' or ''ISO string, Date, null
Time'09:30' (or '09:30:15') or ''ISO string, { hours, minutes, seconds }, null
Date and time'2026-10-12T09:30' or ''ISO string, Date, { date, time }, null
Range{ from, to, preset }a preset id, { from, to } with ISO strings or Date, null

Setting a native input's value in code does not fire events. Call picker.refresh() afterwards, or use setValue.

Released under the MIT License.