The date picker lets users select a single date, multiple dates, or a date range from a calendar, with day, month, and year views.
import {DatePickerModule} from "@qualcomm-ui/angular/date-picker"Overview
- The value is an array of
DateValuefrom @internationalized/date, not a nativeDate. The type is re-exported from@qualcomm-ui/angular/date-picker, along withparseDate,today,getLocalTimeZone, andCalendarDate. - Build values with
parseDate("2026-08-14")for fixed dates, ortoday(getLocalTimeZone())for relative ones. Both return aCalendarDate, a date with no time attached. - To keep a time alongside the date, start from a
CalendarDateTimeorZonedDateTimeinstead. Picking a new day preserves the time. - Avoid converting a native
Date. Only its local year, month, and day are read, so a UTC timestamp such asnew Date("2026-08-14T00:00:00Z")becomes August 13 in time zones behind UTC. Pass the ISO date string toparseDateinstead.
Examples
Single Date
The default selectionMode. Type a date into the field in the locale format, or pick one from the calendar.
<q-date-picker class="w-64" label="Departure date" />
Child Directives
Provide child directives to customize specific elements while keeping the simple API's default structure. Anything not provided falls back to the default.
q-date-picker-control, q-date-picker-input-group, q-date-picker-hint, q-date-picker-error-text, q-date-picker-headline, q-date-picker-headline-label, q-date-picker-headline-value, q-date-picker-presets, and q-date-picker-actions can all be provided this way. Use this to reach inputs the simple API does not expose, such as moreLabel on the headline value.
Providing q-date-picker-actions also adds the footer, so closeOnSelect does not need to be set. The inline variant never shows a footer, so it ignores that directive.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 |
<q-date-picker class="w-64" label="Departure date">
<div q-date-picker-actions>
<button q-date-picker-cancel-trigger>Discard</button>
<button q-date-picker-ok-trigger>Apply</button>
</div>
</q-date-picker>
<q-date-picker
selectionMode="multiple"
variant="inline"
[defaultValue]="defaultValue"
>
<span q-date-picker-headline-label>Travel dates</span>
<span
placeholder="No dates yet"
q-date-picker-headline-value
[moreLabel]="moreLabel"
></span>
</q-date-picker>
Composite
Build with the composite API for granular control. The simple <q-date-picker> renders exactly this tree, including the three q-date-picker-view blocks for the day, month, and year views.
<div
class="w-64"
q-date-picker-root
required
[invalid]="!value().length"
(valueChanged)="onValueChange($event)"
>
<div q-date-picker-control>
<div label="Departure date" q-date-picker-input-group></div>
</div>
<div q-date-picker-hint>Choose a date in mm/dd/yyyy format</div>
<div q-date-picker-error-text>A departure date is required</div>
<ng-template qPortal>
<div q-date-picker-positioner>
<div q-date-picker-content>
<div q-date-picker-view view="day">
<div q-date-picker-view-control>
<button q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
</div>
<table q-date-picker-table>
<thead q-date-picker-day-grid-header></thead>
<tbody q-date-picker-day-grid></tbody>
</table>
</div>
<div q-date-picker-view view="month">
<div q-date-picker-view-control>
<button disabled q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button disabled q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
<button q-date-picker-view-close-trigger></button>
</div>
<table q-date-picker-table>
<tbody q-date-picker-month-grid></tbody>
</table>
</div>
<div q-date-picker-view view="year">
<div q-date-picker-view-control>
<button disabled q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button disabled q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
<button q-date-picker-view-close-trigger></button>
</div>
<table q-date-picker-table>
<tbody q-date-picker-year-grid></tbody>
</table>
</div>
</div>
</div>
</ng-template>
</div>
Range
Set selectionMode="range" to collect a start and end date. Use the separator input on q-date-picker, or on the composite q-date-picker-input-group, to change the character between the two inputs; it defaults to -. The calendar shows a band between the two dates.
A range can be partially filled, in which case the missing end is null.
<q-date-picker class="w-80" label="Trip dates" selectionMode="range" />
Multiple
Set selectionMode="multiple" to collect several dates, shown as dismissible tags in the field. The field is display-only in this mode, so dates are picked from the calendar rather than typed.
Use maxSelectedDates to cap how many dates can be selected.
The popover always shows action buttons in this mode.
<q-date-picker
class="w-80"
label="Maintenance days"
selectionMode="multiple"
[maxSelectedDates]="4"
/>
Action Buttons
Set closeOnSelect to false to add a footer with Cancel and OK buttons. selectionMode="multiple" always includes it.
Selections apply as they are made. OK keeps them and closes the popover, while Cancel, Escape, and clicking outside all revert to the value the popover opened with. The field's clear button applies immediately and is not affected by Cancel.
<q-date-picker
class="w-64"
label="Departure date"
[closeOnSelect]="false"
/>
Open on Click
Set openOnClick to automatically open the popover when the user clicks the field. This keeps focus in it so typing continues.
<q-date-picker class="w-64" label="Departure date" openOnClick />
Presets
Use the presets input to offer common selections, such as the last 7 days. A button in the day view header opens the presets panel.
Each preset is a {label, value} pair, where value is either a named range such as "next7Days" or an explicit DateValue[].
<q-date-picker
class="w-80"
label="Date range"
selectionMode="range"
[presets]="presets"
/>
Sizes
This component supports three size options to accommodate different layout densities.
The available sizes are sm, md, and lg. The default size is md. Size applies to the input field only; the calendar is unaffected.
<q-date-picker class="w-64" label="Small" size="sm" />
<q-date-picker class="w-64" label="Medium" size="md" />
<q-date-picker class="w-64" label="Large" size="lg" />
Hint and Error Text
Add a hint to provide additional context below the field. When invalid is true, the errorText replaces it and the field shows an error indicator icon.
<q-date-picker
class="w-64"
hint="Choose a date in mm/dd/yyyy format"
label="Departure date"
/>
<q-date-picker
class="w-64"
errorText="A departure date is required"
hint="Choose a date in mm/dd/yyyy format"
invalid
label="Departure date"
/>
States
The date picker supports disabled, read-only, and invalid states. When you bind a reactive form control, set the state through the control rather than these inputs.
<q-date-picker
class="w-64"
disabled
label="Disabled"
[defaultValue]="departureDate"
/>
<q-date-picker
class="w-64"
label="Read only"
readOnly
[defaultValue]="departureDate"
/>
<q-date-picker
class="w-64"
errorText="Choose a later date"
invalid
label="Invalid"
[defaultValue]="departureDate"
/>
Min and Max Dates
Use the min and max inputs to bound the selectable dates. Dates outside the bounds are disabled, and typed values are clamped into range.
<q-date-picker
class="w-64"
hint="Within the next 30 days"
label="Departure date"
[max]="max"
[min]="min"
/>
Outside Days
Days from the previous and next month fill the first and last week of the grid. Set hideOutsideDays to leave those cells empty instead.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 |
<q-date-picker hideOutsideDays variant="inline" />
Unavailable Dates
Use the isDateUnavailable input to block individual dates that min and max cannot express, such as weekends or holidays.
<q-date-picker
class="w-64"
hint="Weekends are not available"
label="Delivery date"
[isDateUnavailable]="isWeekend"
/>
Locale
Use the locale input to change how dates are displayed and parsed. It takes a BCP 47 language tag and defaults to en-US. The month and weekday names, the first day of the week, the placeholder, and the separators the field accepts all follow from it. For example, de-DE gives a dd.mm.yyyy placeholder and accepts . as the separator.
Use the startOfWeek input to override only the first day of the week.
<q-date-picker class="w-64" label="Departure date" [locale]="locale()" />
Inline
Set variant to inline to render an always-visible calendar with no field or popover. This variant never shows action buttons and has no inputs, so it does not submit a value with a native form; read the selection through the bound form control.
The inline variant shows a headline with the label and current value. Set [headline]="false" to remove it.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 |
<q-date-picker variant="inline" />
<q-date-picker variant="inline" [headline]="false" />
Custom Trigger
*datePickerContext is a structural directive that hands you the picker api, so you can drive your own presentation from the picker's state. Use it to read the current value, format your own label, or call actions such as clearValue.
<span *datePickerContext="let api">
{{ api.valueAsString[0] || "No date selected" }}
</span>q-date-picker-trigger pairs with it to replace the field entirely. It is a behavioral, unstyled trigger with no styled wrapper, so compose it with q-button on the same element. Place it inside q-date-picker-control, which anchors the popover.
<button *datePickerContext="let api" q-button q-date-picker-trigger variant="outline">
{{ api.valueAsString[0] || "Pick a date" }}
</button>Accessibility attributes, focus restoration, and dismissal behavior come from the picker, so you do not write them yourself.
<div q-date-picker-root [closeOnSelect]="false">
<div
*datePickerContext="let api"
class="flex gap-2"
q-date-picker-control
>
<button q-button q-date-picker-trigger variant="outline">
{{ api.valueAsString[0] || "Pick a date" }}
</button>
@if (api.value.length) {
<button
q-button
type="button"
variant="ghost"
(click)="api.clearValue()"
>
Clear
</button>
}
</div>
<ng-template qPortal>
<div q-date-picker-positioner>
<div q-date-picker-content>
<div q-date-picker-headline>
<span q-date-picker-headline-label></span>
<span q-date-picker-headline-value></span>
</div>
<div q-date-picker-view view="day">
<div q-date-picker-view-control>
<button q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
</div>
<table q-date-picker-table>
<thead q-date-picker-day-grid-header></thead>
<tbody q-date-picker-day-grid></tbody>
</table>
</div>
<div q-date-picker-view view="month">
<div q-date-picker-view-control>
<button disabled q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button disabled q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
<button q-date-picker-view-close-trigger></button>
</div>
<table q-date-picker-table>
<tbody q-date-picker-month-grid></tbody>
</table>
</div>
<div q-date-picker-view view="year">
<div q-date-picker-view-control>
<button disabled q-date-picker-view-trigger view="month">
<q-date-picker-month-text />
</button>
<button disabled q-date-picker-view-trigger view="year">
<q-date-picker-year-text />
</button>
<button q-date-picker-prev-trigger></button>
<button q-date-picker-next-trigger></button>
<button q-date-picker-view-close-trigger></button>
</div>
<table q-date-picker-table>
<tbody q-date-picker-year-grid></tbody>
</table>
</div>
<div q-date-picker-actions>
<button q-date-picker-cancel-trigger></button>
<button q-date-picker-ok-trigger></button>
</div>
</div>
</div>
</ng-template>
</div>
Within Dialog
Set disablePortal to render the calendar popover in place rather than at the end of document.body. This is required inside a Dialog or Popover.
<q-date-picker class="w-64" disablePortal label="Departure date" />
Forms
The control value is an array of DateValue | null, and entries can be null when a range is partially filled.
The selection is also submitted natively under name, and the number of entries follows the selection mode: one for a single date, two for a range, and one per date in multiple mode. Entries arrive in document order, so a range is always start then end.
A range keeps the position of each end, so clearing only the start submits an empty first entry with the end date second. Read a range by position rather than by taking the first non-empty entry.
Resetting the form restores the initial value.
Reactive Forms
Bind a FormControl with [formControl] or formControlName. The disabled, invalid, and required inputs have no effect in this case; use the equivalent form control bindings instead.
In range mode, a required control also applies a validator that rejects a partially filled range.
import {Component, inject} from "@angular/core"
import {FormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"
import {ButtonModule} from "@qualcomm-ui/angular/button"
import {DatePickerModule} from "@qualcomm-ui/angular/date-picker"
import type {DateValue} from "@qualcomm-ui/core/date-picker"
@Component({
imports: [DatePickerModule, ReactiveFormsModule, ButtonModule],
selector: "date-picker-reactive-forms-demo",
template: `
<form
class="flex w-64 flex-col gap-2"
[formGroup]="form"
(ngSubmit)="onSubmit()"
>
<q-date-picker
errorText="A departure date is required"
formControlName="departureDate"
hint="Choose a date in mm/dd/yyyy format"
label="Departure date"
/>
<div class="mt-1 grid grid-cols-2 grid-rows-1 gap-3">
<button
emphasis="primary"
q-button
size="sm"
type="button"
variant="outline"
(click)="reset()"
>
Reset
</button>
<button
emphasis="primary"
q-button
size="sm"
type="submit"
variant="fill"
>
Submit
</button>
</div>
</form>
`,
})
export class DatePickerReactiveFormsDemo {
private fb = inject(FormBuilder)
form = this.fb.group({
departureDate: [[] as (DateValue | null)[], Validators.required],
})
onSubmit() {
if (this.form.valid) {
console.log("Form submitted:", {
...this.form.value,
})
}
}
reset() {
this.form.reset({
departureDate: [],
})
}
}Template Forms
Bind ngModel for template-driven forms. Here the disabled, readOnly, invalid, and required inputs govern the state of the control.
<q-date-picker
class="w-64"
hint="Choose a date in mm/dd/yyyy format"
label="Departure date"
[(ngModel)]="value"
/>
Explorer
Component Anatomy
Hover to highlight, click to view API
API
<q-date-picker>
The simple date picker extends the q-date-picker-root directive with the following properties:
booleanstringinvalid is true.<div q-date-picker-error-text>...</div>
booleanbooleaninline variant.string<div q-date-picker-hint>...</div>
stringArray<{
label: string
value:
| Array<DateValue>
| 'thisWeek'
| 'lastWeek'
| 'nextWeek'
| 'thisMonth'
| 'lastMonth'
| 'nextMonth'
| 'thisQuarter'
| 'lastQuarter'
| 'nextQuarter'
| 'thisYear'
| 'lastYear'
| 'nextYear'
| 'last3Days'
| 'last7Days'
| 'last14Days'
| 'last30Days'
| 'last90Days'
| 'next3Days'
| 'next7Days'
| 'next14Days'
| 'next30Days'
| 'next90Days'
}>
string| 'input'
| 'inline'
-
input - a labelled field that opens the calendar in a popover.-
inline - an always-visible, flat calendar that commits on selection.Composite API
This section describes the elements of the date picker's composite API.
q-date-picker-root
booleanmultiple.(
identifier: CalendarIdentifier,
) => Calendar
DateValuebooleanDateValue[]
| 'day'
| 'month'
| 'year'
'ltr' | 'rtl'
booleanbooleanDateValue(
date: DateValue,
details: {
locale: string
timeZone: string
},
) => string
booleanbooleanbooleanboolean(
date: DateValue,
locale: string,
) => boolean
booleanstringDateValuenumbermultiple.| 'day'
| 'month'
| 'year'
DateValue| 'day'
| 'month'
| 'year'
stringbooleanbooleanboolean(
value: string,
details: {
locale: string
timeZone: string
},
) => DateValue
DateValue.stringbooleanbooleanboolean| 'single'
| 'multiple'
| 'range'
-
single - only one date can be selected-
multiple - multiple dates can be selected-
range - a range of dates can be selected| 'sm'
| 'md'
| 'lg'
booleannumber0 is Sunday, 6 is Saturday.string{
clearTrigger?: string
content?: string
dayCell?: (state: {
disabled: boolean
firstInHoveredRange: boolean
firstInRange: boolean
focused: boolean
inHoveredRange: boolean
inRange: boolean
invalid: boolean
lastInHoveredRange: boolean
lastInRange: boolean
outsideRange: boolean
selectable: boolean
selected: boolean
today: boolean
unavailable: boolean
value: DateValue
valueText: string
weekend: boolean
}) => string
errorIndicator?: string
inputDescription?: (
format: string,
) => string
nextTrigger?: (
view:
| 'day'
| 'month'
| 'year',
) => string
placeholder?: (
locale: string,
) => {
day: string
month: string
year: string
}
presetsTrigger?: (
open: boolean,
) => string
presetTrigger?: (
value: string[],
) => string
prevTrigger?: (
view:
| 'day'
| 'month'
| 'year',
) => string
rangeInputEnd?: string
rangeInputStart?: string
trigger?: (state: {
open: boolean
selectionMode:
| 'single'
| 'multiple'
| 'range'
valueText: string[]
}) => string
viewCloseTrigger?: string
viewTrigger?: (
view:
| 'day'
| 'month'
| 'year',
targetView?:
| 'day'
| 'month'
| 'year',
) => string
}
boolean| 'day'
| 'month'
| 'year'
| 'previous'
| 'min'
-
previous - year to month to day-
min - the current view to the minimum viewvoid{
focusedValue: DateValue
value: Array<DateValue>
valueAsString: string[]
view:
| 'day'
| 'month'
| 'year'
}
{
open: boolean
value: Array<DateValue>
}
{
value: Array<DateValue>
valueAsString: string[]
view:
| 'day'
| 'month'
| 'year'
}
{
view:
| 'day'
| 'month'
| 'year'
}
{
view:
| 'day'
| 'month'
| 'year'
visibleRange: {
end: DateValue
start: DateValue
}
}
class'qui-date-picker__root'data-date-picker-part'root'data-disableddata-emptydata-hide-outside-daysdata-readonlydata-state| 'open'
| 'closed'
q-date-picker-label
number0 for the start date and 1 for the end date.class'qui-input__label qui-date-picker__label'data-date-picker-part'label'data-disableddata-readonlydata-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
q-date-picker-control
stringdata-date-picker-part'control'data-disableddata-placeholder-shownq-date-picker-input-group
See Shortcuts for the tree this renders in each selection mode.
(
dateText: string,
) => string
multiple mode.booleanstringstringmultiple mode.stringclass'qui-input__input-group qui-date-picker__input-group'data-date-picker-part'input-group'data-invaliddata-size| 'sm'
| 'md'
| 'lg'
q-date-picker-input-group-trigger
The bordered field inside the input group. In multiple mode it also acts as the
calendar trigger, because no text input owns focus there.
multiple mode turns it
into the calendar trigger since no text input owns focus there.Do not add a second binding system to this element:
role, dir, and
aria-invalid change source with the mode, so two writers clobber each other
on a runtime mode switch. Must stay in useTrackBindings — id registration
writes a signal, which a computed forbids (NG0600).stringdata-disableddata-placeholder-showndata-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-readonlydata-side| 'top'
| 'right'
| 'bottom'
| 'left'
data-state| 'open'
| 'closed'
tabIndexnumberq-date-picker-input
A range picker renders two inputs, distinguished by index.
booleanstringnumber0 for
the start date and 1 for the end date.class'qui-input__input qui-date-picker__input'data-date-picker-part'input'data-indexnumberdata-invaliddata-placeholder-showndata-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
q-date-picker-value-tags
multiple mode as dismissible tags. Renders a
visually hidden input per selected date so the selection participates in form
submission under the picker's name.(
dateText: string,
) => string
stringclass'qui-date-picker__value-tags'data-date-picker-part'hidden-input'data-indexnumberstyletabIndexnumberq-date-picker-clear-trigger
Applies the clear behavior to any element, without QDS styling. Use it to build a custom clear control. For the styled control used inside the input group, see q-date-picker-input-clear-trigger.
stringdata-date-picker-part'clear-trigger'hiddenbooleanq-date-picker-input-clear-trigger
The clear trigger as it is styled inside the input group: a
q-date-picker-clear-trigger rendered as an
icon button with compact density and a default X icon.
Project content to replace the icon.
stringdata-date-picker-part'clear-trigger'hiddenbooleanq-date-picker-error-indicator
| LucideIcon
| LucideIconData
| string
class'qui-input__error-indicator'data-date-picker-part'error-indicator'data-size| 'sm'
| 'md'
| 'lg'
hiddenbooleanq-date-picker-trigger
Applies the open and close behavior to any element, without QDS styling. Use it to build a custom trigger. For the styled control used inside the input group, see q-date-picker-input-trigger.
stringdata-date-picker-part'trigger'data-placeholder-showndata-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-side| 'top'
| 'right'
| 'bottom'
| 'left'
data-state| 'open'
| 'closed'
q-date-picker-input-trigger
The calendar trigger as it is styled inside the input group: a
q-date-picker-trigger rendered as an
icon button with compact density and a default Calendar
icon. Project content to replace the icon.
In multiple mode the input group renders a non-interactive calendar icon
instead, because q-date-picker-input-group-trigger carries the trigger
bindings.
stringdata-date-picker-part'trigger'data-placeholder-showndata-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-side| 'top'
| 'right'
| 'bottom'
| 'left'
data-state| 'open'
| 'closed'
q-date-picker-hint
stringdata-date-picker-part'hint'data-disabledhiddenbooleanq-date-picker-error-text
stringdata-date-picker-part'error-text'hiddenbooleanq-date-picker-positioner
stringdata-date-picker-part'positioner'styleq-date-picker-content
stringdata-date-picker-part'content'data-inlinedata-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-presets-opendata-side| 'top'
| 'right'
| 'bottom'
| 'left'
data-state| 'open'
| 'closed'
hiddenbooleantabIndex-1
q-date-picker-headline
class'qui-date-picker__headline'data-date-picker-part'headline'q-date-picker-headline-label
The default caption is Date range in range mode and Date otherwise. Pass content to override it.
class'qui-date-picker__headline-label'data-date-picker-part'headline-label'q-date-picker-headline-value
In multiple mode this shows up to two dates then appends a count suffix.
DateTimeFormatOptions(
count: number,
) => string
multiple mode when more than two dates are selected.string[
string,
string,
]
class'qui-date-picker__headline-value'data-date-picker-part'headline-value'q-date-picker-view
| 'day'
| 'month'
| 'year'
data-date-picker-part'view'data-view| 'day'
| 'month'
| 'year'
hiddenbooleanq-date-picker-view-control
data-date-picker-part'view-control'data-view| 'day'
| 'month'
| 'year'
q-date-picker-view-trigger
boolean| 'day'
| 'month'
| 'year'
data-date-picker-part'view-trigger'data-view| 'day'
| 'month'
| 'year'
q-date-picker-view-close-trigger
data-date-picker-part'view-close-trigger'q-date-picker-prev-trigger
Disabled when the previous page falls entirely outside min.
| 'day'
| 'month'
| 'year'
View.data-date-picker-part'prev-trigger'data-disabledq-date-picker-next-trigger
Disabled when the next page falls entirely outside max.
| 'day'
| 'month'
| 'year'
View.data-date-picker-part'next-trigger'data-disabledq-date-picker-month-text
| '2-digit'
| 'long'
| 'narrow'
| 'numeric'
| 'short'
q-date-picker-year-text
| '2-digit'
| 'numeric'
q-date-picker-range-text
data-date-picker-part'range-text'q-date-picker-table
The column count is fixed per view.
columns input
of the core directive is ignored.| 'day'
| 'month'
| 'year'
View.data-columnsnumberdata-date-picker-part'table'data-view| 'day'
| 'month'
| 'year'
tabIndex-1
q-date-picker-table-head
data-date-picker-part'table-head'data-disableddata-view| 'day'
| 'month'
| 'year'
q-date-picker-table-header
data-date-picker-part'table-header'data-disableddata-view| 'day'
| 'month'
| 'year'
q-date-picker-table-body
data-date-picker-part'table-body'data-disableddata-view| 'day'
| 'month'
| 'year'
q-date-picker-table-row
data-date-picker-part'table-row'data-disableddata-view| 'day'
| 'month'
| 'year'
q-date-picker-table-cell
The bindings differ by the view the cell belongs to.
| number
| DateValue
DateValue in the day view, the month or year number
otherwise.numberboolean{
end: T
start: T
}
data-date-picker-part'table-cell'data-selecteddata-valuenumberq-date-picker-table-cell-trigger
The bindings differ by the view the cell belongs to.
data-date-picker-part'table-cell-trigger'data-disableddata-focusdata-hover-range-enddata-hover-range-startdata-in-hover-rangedata-in-rangedata-outside-rangedata-range-enddata-range-startdata-selectabledata-selecteddata-todaydata-unavailabledata-valuenumberdata-view'year'data-weekendtabIndex-1 | 0
q-date-picker-day-grid-header
thead
element.Extract<
keyof {
long: string
narrow: string
short: string
value: DateValue
},
'long' | 'narrow' | 'short'
>
q-date-picker-day-grid
tbody element.q-date-picker-month-grid
tbody element.NonNullable<
'long' | 'short'
>
q-date-picker-year-grid
Renders the year cells for the year view. Takes no inputs.
q-date-picker-presets
data-date-picker-part'presets'hiddenbooleanq-date-picker-presets-trigger
data-date-picker-part'presets-trigger'q-date-picker-preset-trigger
| Array<DateValue>
| 'thisWeek'
| 'lastWeek'
| 'nextWeek'
| 'thisMonth'
| 'lastMonth'
| 'nextMonth'
| 'thisQuarter'
| 'lastQuarter'
| 'nextQuarter'
| 'thisYear'
| 'lastYear'
| 'nextYear'
| 'last3Days'
| 'last7Days'
| 'last14Days'
| 'last30Days'
| 'last90Days'
| 'next3Days'
| 'next7Days'
| 'next14Days'
| 'next30Days'
| 'next90Days'
"next7Days") or an explicit array of dates.data-date-picker-part'preset-trigger'q-date-picker-actions
closeOnSelect is false.class'qui-date-picker__actions'data-date-picker-part'actions'q-date-picker-cancel-trigger
q-date-picker-ok-trigger
datePickerContext
This abstract class provides the core functionality to: 1. Check if a required API context service is available 2. Render the associated template only when the API instance is accessible 3. Provide the API instance to the template as a typed value
DatePickerApi
The api handed to the *datePickerContext structural directive.
VoidFunction(options?: {
focus?: boolean
}) => void
booleanbooleanDateValueDatestring(
month: number,
) => void
(
year: number,
) => void
(
value: DateValue,
opts?: DateTimeFormatOptions,
) => string
(
week: number,
from?: DateValue,
) => Array<DateValue>
(props: {
disabled?: boolean
value: DateValue
visibleRange?: {
end: T
start: T
}
}) => {
disabled: boolean
firstInHoveredRange: boolean
firstInRange: boolean
focused: boolean
inHoveredRange: boolean
inRange: boolean
invalid: boolean
lastInHoveredRange: boolean
lastInRange: boolean
outsideRange: boolean
selectable: boolean
selected: boolean
today: boolean
unavailable: boolean
value: DateValue
valueText: string
weekend: boolean
}
() => {
end: T
start: T
}
(props?: {
format?: 'long' | 'short'
}) => Array<{
disabled?: boolean
label: string
value: number
}>
(props?: {
columns?: number
format?: 'long' | 'short'
}) => Array<
Array<{
disabled?: boolean
label: string
value: number
}>
>
(props: {
columns?: number
disabled?: boolean
value: number
}) => {
disabled: boolean
firstInHoveredRange: boolean
firstInRange: boolean
focused: boolean
inHoveredRange: boolean
inRange: boolean
lastInHoveredRange: boolean
lastInRange: boolean
outsideRange: boolean
selectable: boolean
selected: boolean
value: DateValue
valueText: string
}
(
from?: DateValue,
) => Array<Array<DateValue>>
(
duration: DateDuration,
) => {
visibleRange: {
end: T
start: T
}
visibleRangeText: {
end: string
start: string
}
weeks: Array<
Array<DateValue>
>
}
(
value:
| 'thisWeek'
| 'lastWeek'
| 'nextWeek'
| 'thisMonth'
| 'lastMonth'
| 'nextMonth'
| 'thisQuarter'
| 'lastQuarter'
| 'nextQuarter'
| 'thisYear'
| 'lastYear'
| 'nextYear'
| 'last3Days'
| 'last7Days'
| 'last14Days'
| 'last30Days'
| 'last90Days'
| 'next3Days'
| 'next7Days'
| 'next14Days'
| 'next30Days'
| 'next90Days',
) => Array<DateValue>
() => Array<{
disabled?: boolean
label: string
value: number
}>
(props?: {
columns?: number
}) => Array<
Array<{
disabled?: boolean
label: string
value: number
}>
>
(props: {
columns?: number
disabled?: boolean
value: number
}) => {
disabled: boolean
firstInHoveredRange: boolean
firstInRange: boolean
focused: boolean
inHoveredRange: boolean
inRange: boolean
lastInHoveredRange: boolean
lastInRange: boolean
outsideRange: boolean
selectable: boolean
selected: boolean
value: DateValue
valueText: string
}
VoidFunctionVoidFunctionbooleanbooleanboolean(
date: DateValue,
) => boolean
numbernumberbooleanbooleanboolean| 'single'
| 'multiple'
| 'range'
VoidFunction(
value: DateValue,
) => void
(
open: boolean,
) => void
(
time: {
hour?: number
millisecond?: number
minute?: number
second?: number
},
index?: number,
) => void
(
values: Array<DateValue>,
) => void
(
view:
| 'day'
| 'month'
| 'year',
) => void
(
value: DateValue,
) => void
Array<DateValue>
Array<Date>
string[]
| 'day'
| 'month'
| 'year'
{
end: T
start: T
}
{
end: string
formatted: string
start: string
}
Array<{
long: string
narrow: string
short: string
value: DateValue
}>
Array<Array<DateValue>>
Data Structures
DatePickerPositioningOptions
numberstring[data-menu-part=arrow]).() =>
| 'clippingAncestors'
| Element
| Array<Element>
| {
height: number
width: number
x: number
y: number
}
boolean| boolean
| Array<
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
>
(
element:
| HTMLElement
| VirtualElement,
) => {
height?: number
width?: number
x?: number
y?: number
}
numberboolean| boolean
| {
ancestorResize?: boolean
ancestorScroll?: boolean
animationFrame?: boolean
elementResize?: boolean
layoutShift?: boolean
}
{
crossAxis?: number
mainAxis?: number
}
(
data: ComputePositionReturn,
) => void
(data: {
placed: boolean
}) => void
numberboolean| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
booleannumberboolean| 'absolute'
| 'fixed'
(data: {
updatePosition: () => Promise<void>
}) => void | Promise<void>
Shortcuts
q-date-picker-input-group
Groups the field parts into one bordered control. For a single date picker it renders roughly this structure:
<label q-date-picker-label>{{ label }}</label>
<div q-date-picker-input-group-trigger>
<input q-date-picker-input [index]="0" />
<button q-date-picker-input-clear-trigger></button>
<span aria-hidden></span>
<span q-date-picker-error-indicator></span>
<button q-date-picker-input-trigger></button>
</div>The two buttons are compact icon buttons, and the empty span is the divider between the input and the triggers. See q-date-picker-input-clear-trigger and q-date-picker-input-trigger.
In range mode it renders two inputs with the separator between them:
<input q-date-picker-input [index]="0" />
<span aria-hidden>{{ separator }}</span>
<input q-date-picker-input [index]="1" />In multiple mode it renders q-date-picker-value-tags in place of the inputs:
<span
q-date-picker-value-tags
[dismissLabel]="dismissLabel"
[placeholder]="placeholder"
></span>Multiple mode also replaces the calendar trigger with a non-interactive calendar icon, because the field itself carries the trigger bindings.
q-date-picker-day-grid-header
Renders the weekday header row of the day view. This shortcut is equivalent to:
<thead q-date-picker-table-head>
<tr q-date-picker-table-row>
@for (weekDay of weekDays; track $index) {
<th
q-date-picker-table-header
scope="col"
[attr.aria-label]="weekDay.long"
>
{{ weekDay[format] }}
</th>
}
</tr>
</thead>q-date-picker-day-grid
Renders the day cells of the visible month. This shortcut is equivalent to:
<tbody q-date-picker-table-body>
@for (week of weeks; track $index) {
<tr q-date-picker-table-row>
@for (day of week; track $index) {
<td
q-date-picker-table-cell
[value]="day"
[visibleRange]="visibleRange"
>
<div q-date-picker-table-cell-trigger>{{ day.day }}</div>
</td>
}
</tr>
}
</tbody>q-date-picker-month-grid
Renders the month cells of the month view. This shortcut is equivalent to:
<tbody q-date-picker-table-body>
@for (months of getMonthsGrid({columns, format}); track $index) {
<tr q-date-picker-table-row>
@for (month of months; track $index) {
<td q-date-picker-table-cell [value]="month.value">
<div q-date-picker-table-cell-trigger>{{ month.label }}</div>
</td>
}
</tr>
}
</tbody>q-date-picker-year-grid
Renders the year cells of the year view. This shortcut is equivalent to:
<tbody q-date-picker-table-body>
@for (years of getYearsGrid({columns}); track $index) {
<tr q-date-picker-table-row>
@for (year of years; track $index) {
<td q-date-picker-table-cell [value]="year.value">
<div q-date-picker-table-cell-trigger>{{ year.label }}</div>
</td>
}
</tr>
}
</tbody>
inlinecalendar. For finer control, compose the parts yourself withq-date-picker-rootand friends.