QdsDatePicker

Date and date-range entry: a text field that parses typed dates, plus a calendar popover.

Overview

The qds-date-picker is designed for as-of dates, effective dates, reporting periods, and date ranges in financial applications. Typing is the primary input method; the calendar is an aid, not the input method. The value is always an ISO date string (YYYY-MM-DD), never a Date object – a Date drags a timezone into a field that has no time, and an as-of date that shifts a day in UTC is a reporting defect.

The text field accepts the display format (derived from the locale) plus unambiguous shorthand. The field shows its expected format as the placeholder (MM/DD/YYYY in en-US), so 3/7 is never a guess.

Choosing a day by pointer or keyboard updates the visible text together with the ISO value before input and change events fire. Completing a range immediately displays both endpoints. Consumers, including generated Quangular form bindings, do not need to echo the value back to refresh the field.

Do NOT use this component for a birth date or any date far from today – three text inputs or a typed field with no calendar is faster than paging a calendar back forty years. Do NOT use it for month or quarter selection; that wants a period picker.

Usage

<qds-date-picker label="As-of date" value="2026-03-07"></qds-date-picker>

Range mode:

<qds-date-picker
  label="Reporting period"
  range
  min="2026-01-01"
  max="2026-12-31"
  name="period"
></qds-date-picker>

With shortcuts and week numbers:

<script type="module">
  const dp = document.querySelector('qds-date-picker');
  dp.shortcuts = [
    { label: 'Prior month end', value: '2026-02-28' },
    { label: 'YTD', value: '2026-01-01,2026-03-07' },
  ];
</script>
<qds-date-picker
  label="As-of date"
  show-week-numbers
  first-day-of-week="1"
></qds-date-picker>

Typed Date Shorthand

The text field accepts the following input formats. All are parsed on blur and the field re-renders with the canonical display format.

Display format

Type a date in the format shown by the placeholder. In en-US this is MM/DD/YYYY. In other locales the order and separator follow Intl.DateTimeFormat.

ISO format

Compact numeric

Named month

Shorthand tokens

Token Meaning Example (today = 2026-06-15)
t Today 2026-06-15
t+N Today plus N days t+30 = 2026-07-15
t-N Today minus N days t-1 = 2026-06-14
eom End of current month 2026-06-30
eoq End of current quarter 2026-06-30 (Q2)
eoy End of current year 2026-12-31

Range mode typing

In range mode, type two dates separated by - or to:

API Reference

Attributes

Properties

CSS Parts

CSS Custom Properties

Events

Validation

Range Mode

One field, two dates. The display shows 03/07/2026 - 03/31/2026. First click sets the start and arms the end; second click sets the end. A second click before the start restarts the selection rather than producing an inverted range. Two months are shown side by side at 600px or wider, stacked below that. Paging moves both months by one. Hovering a candidate end previews the range.

Keyboard

Key Field Calendar open
Typing Enters a date Passes through to the field
ArrowDown Opens the calendar +1 week
ArrowUp Opens -1 week
ArrowLeft / ArrowRight Caret movement -1 / +1 day
PageUp / PageDown – -1 / +1 month
Shift + PageUp / PageDown – -1 / +1 year
Home / End Caret First / last day of month
Enter Commits typed text Selects focused day, closes (single mode)
Escape – Closes, keeps the field value

Example

<qds-field label="As-of date" required hint="Enter or pick a date">
  <qds-date-picker
    name="asOf"
    required
    min="2026-01-01"
    max="2026-12-31"
    clearable
  ></qds-date-picker>
</qds-field>

Native fieldset disabling

Keep related controls in a native fieldset with a descriptive legend. Ancestor disabling is retained separately from the control’s own disabled attribute: assigning disabled = false cannot override a disabled ancestor. Re-enabling the fieldset restores interaction unless the control is explicitly disabled. Reporting values are retained while disabled. Generated Quangular forms respect the same effective state without turning ancestor state into a sticky own attribute.

The native demo includes a reporting-fieldset toggle and a disabled = false probe so this behavior can be checked alongside normal property disabling.