Date Picker

A button showing a date that opens a calendar in a popover, for one date or a range, as a form control with Intl formatting.

Available in
  • Angular: available
  • Vue: available
  • React: available
  • React Native: available

Usage

Import

ts
import {
  SoneDatePickerComponent,
} from "@surface-one/angular/date-picker";

API reference

SoneDatePickerComponentComponent

`<sone-date-picker>` — a field-like button that opens a calendar in a popover (shadcn/ui Date Picker): `[(value)]` is "YYYY-MM-DD" (or `{ start, end }` with `mode="range"`), shown through `Intl` in `locale`. The popover closes on a pick (a whole range) and gives focus back to the button; it is also a form control.

Selector
sone-date-picker
Inputs
NameType Default
mode

One date (`single`, the default) or a range (`range`).

SoneDatePickerMode"single"
valuetwo-way

The picked date "YYYY-MM-DD" or `{ start, end }` (`range`) — `[(value)]`.

SoneCalendarValuenull
opentwo-way

The calendar is open — `[(open)]`.

booleanfalse
placeholder

Shown while no date is picked.

—$localize`:Date picker placeholder:Pick a date`
min

The earliest and latest date that can be picked ("YYYY-MM-DD").

string | nullnull
maxstring | nullnull
disabledDate

Refuses more dates: `(iso) => true` disables that day.

((iso: string) => boolean) | nullnull
weekStartsOn

The first day of the week: 0 = Sunday (the default) … 6 = Saturday.

SoneWeekday0
locale

A BCP 47 tag for the shown date and the calendar (default: the app's `LOCALE_ID`).

string | nullnull
formatOptions

How the date is shown (`Intl.DateTimeFormat` options); a long date by default.

Intl.DateTimeFormatOptions{ dateStyle: "long", }
today

Today for the calendar, "YYYY-MM-DD" (default: the browser's, read after render).

string | nullnull
closeOnSelect

Close the calendar once a date (or a whole range) is picked.

booleantrue
disabledbooleanfalse
invalidbooleanfalse
triggerId

The button's `id`, for a `<label for>`.

string | nullnull
ariaLabel

Names the picker when no `<label>` does: read with the date, "Due date: May 4, 2026".

string | nullnull
ariaDescribedby

Extra ids for the button's `aria-describedby` (a hint, an error).

string | nullnull
dialogLabel

Names the calendar popover.

—$localize`:Date picker dialog:Choose a date`
Outputs
NameType
dateSelect

Fires on every pick, with the day picked.

string