date-selekt

Dates, times, ranges — format-aware

Types — date, datetime, time (live)

The default type.
date-selekt-type="datetime".
type="time" + minute-step="5".

Ranges — one input; the second value posts as a hidden <name>_to field

Constraints & states — min/max, readonly

date-selekt-min-date/-max-date take ISO dates or today±N.
A native readonly input shows the value, no picker.

The rules

  • A text input + the date-selekt attribute; init once with g.dateSelekt('[date-selekt]'). The DISPLAY follows the install's date/time format (the same one g.format uses); the submitted value is ISO — the API never sees display formats.
  • Picking the type: date (default) for calendar dates; datetime when the HOUR matters (events, deadlines with time); time alone for schedules — set date-selekt-minute-step to the real granularity (5, 15…), never leave minute-precision on things booked by the quarter hour.
  • Ranges are ONE input with date-selekt-range (works with all three types; the second value posts as a hidden <name>_to field) — filters, reports, shifts. Two RELATED dates of a record (start/end columns) stay two single inputs.
  • Bound the pickable window with date-selekt-min-date/-max-date (ISO or today±N) instead of validating after the fact.
  • Use it for every date the user picks; the native type="date" is acceptable only in throwaway internal tools.
  • Docs: templates/app/docs/libs/date-selekt.md; the full harness (all types, presets, formats): /tests/date-selekt.