Date Time Picker
A date and a time typed in a Date Time Input, or picked in a popover beside it: the day in a calendar, the time in columns — on the input's clock, locale and limits.
Usage
Usage
2026-11-02T14:30:00
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerTrigger,Anatomy
The picker holds your field — the Date Time Input, the value, the locale, the clock, the limits: put [formField] on it — and a button that opens the popover: your Calendar, and the Time Picker's columns beside it.
import { ScCalendar, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerTrigger, ScTimePickerColumns,} from '@semantic-components/ui';<div scDateTimePicker #dtp="scDateTimePicker"> <div scPopoverProvider [origin]="anchor"> <div scInputGroup cdkOverlayOrigin #anchor="cdkOverlayOrigin"> <div scDateTimeInput [formField]="form.departure"></div> <div scInputGroupAddon side="inline-end"> <button scDateTimePickerTrigger>…icon, name…</button> </div> </div> <ng-template scPopoverPortal> <div scPopover class="w-auto flex-row gap-0 p-0" aria-label="…"> <div scCalendar initialFocus [value]="dtp.date()" [minDate]="dtp.minDate()" [maxDate]="dtp.maxDate()" [unavailable]="dtp.unavailable()" (valueChange)="dtp.pickDate($event)">…</div> <div scTimePickerColumns [initialFocus]="false"></div> </div> </ng-template> </div></div>Picking
A day picked in the calendar sets the input's date, a value picked in a column its time's part — at once, as typing does; the value comes once both are there. It opens on the day, focus in the calendar; the columns at the time.
Closing — the same in every picker: each pick moves on to the next part — the day to the hour, the hour to the minutes, the minutes to AM/PM, and the popover closes once the value is whole, focus back on the trigger. With [closeOnPick]="false" the picks still move on, but it stays open until Enter (keeping what is picked), Escape or a click outside. The arrow keys only browse. With confirm, nothing closes by itself: Apply (or Enter) keeps what is picked; Cancel, Escape or a click outside leave the value as it was before it opened.
Give the calendar the picker's date(), minDate(), maxDate() and unavailable(): they are the input's. On the first or last day, the times outside the limits can't be picked.
Accessibility
- The button is named by you, and says the popover is open; the popover is a dialog, named by you; the calendar is a grid, each time column a listbox named in the locale's words.
- Tab goes from the calendar to the columns; in them, ← / → move between columns, ↑ / ↓ pick.
- Typing in the field is always there: the popover is another way, not the only one.
Examples
Steps
2026-11-02T10:15:00
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerTrigger,Apply
2026-11-02T14:30:00
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerApply,Limits
2026-11-02T10:00:00
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerTrigger,Locale
2026-11-02T14:30:00
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker, ScDateTimePickerTrigger,Form
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { FormField, FormRoot, form, required } from '@angular/forms/signals';import { ScButton, ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput,RTL
2026-11-02T14:30:00
import { Dir } from '@angular/cdk/bidi';import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, ScDateTimeInput, ScDateTimePicker,API reference
Each part takes class, merged over its own (cn: a later class wins). The value, the clock and the limits are the Date Time Input's; the calendar is the Calendar, the columns the Time Picker's.
| Part | Selector | Description |
|---|---|---|
ScDateTimePicker | div[scDateTimePicker] | The root: reads its Date Time Input; the columns’ steps. exportAs scDateTimePicker: date(), minDate(), maxDate(), unavailable() for the calendar; pickDate(value), pick(part, value), enabled(part, value), close(). |
ScDateTimePickerTrigger | button[scDateTimePickerTrigger] | Opens and closes the popover: ghost in an input group (buttonSize), outline alone (variant). Write its icon and name. |
ScTimePickerColumns | div[scTimePickerColumns] | The Time Picker’s columns, for the time: [initialFocus]="false" here — the calendar takes the focus. |
ScDateTimePickerApply / Cancel | button[scDateTimePickerApply], button[scDateTimePickerCancel] | confirm: Apply keeps what is picked (disabled until the value is whole); Cancel puts back the value from before — closed either way. The style’s buttons; your text. |
| Input | Type | Default | Description |
|---|---|---|---|
closeOnPick | boolean | true | Each pick moves on to the next part; the popover closes once the value is whole. False: it stays open until Enter, Escape or a click outside. |
confirm | boolean | false | Nothing closes by itself: Apply (or Enter) keeps what is picked; Cancel, Escape or a click outside put back the value from before. |
minuteStep | number | 1 | Minutes between the minute column’s values. |
secondStep | number | 1 | Seconds between the second column’s values. |