Import

import-date-picker.ts
import {
NuiDateField,
NuiDatePicker,
NuiDateRangePicker,
NuiTimeField,
} from '@needless-ui/angular/date-picker';

NuiDateField

A date, or a date and time, typed in segments.

Selector
nui-date-field
NuiDateField: Properties
NameTypeDefaultDescription
valueTwo-wayNuiDate | NuiDateTime | nullnullThe value, or null until every segment is filled.
granularityInput'day' | 'hour' | 'minute' | 'second''day'Stops at the day, or goes on to the hour, minute or second.
min, maxInputstring | nullThe earliest and latest values. Outside them, the field is invalid.
placeholderInputstring | nullnowWhere empty segments start from with the arrow keys.
hourCycleInput12 | 24A 12- or 24-hour clock. By default, the locale’s.
minuteStepInputnumber1How far the arrow keys move the minutes.
disabled, readonlyInputbooleanfalseStop changes.
localeInputstringLOCALE_IDSets the order, separators, digits and clock.
labelsInputPartial<NuiDateFieldLabels>Every text the field says, to translate.
invalidPropertySignal<boolean>Whether the value is outside min and max.
focusMethod() => voidFocuses the first empty segment.

NuiTimeField

A time of day typed in segments. It takes the same inputs as the date field.

Selector
nui-time-field
NuiTimeField: Properties
NameTypeDefaultDescription
granularityInput'hour' | 'minute' | 'second''minute'Stops at the hour, minute or second.

NuiDatePicker

A date field with a calendar in a popover. It takes the date field’s inputs, and these.

Selector
nui-date-picker
NuiDatePicker: Properties
NameTypeDefaultDescription
unavailableInput(date: NuiDate) => booleanDays the calendar won’t pick.
firstDay, weekNumbersInput1 … 7, booleanPassed to the calendar.
labelsInputPartial<NuiDatePickerLabels>The texts of the field, the button and the calendar.
cornersInputNuiCornersThe shape of its corners: round, squircle, bevel, scoop, notch or square.
radiusInputNuiRadiusHow big its corners are: none, small, medium, large or full.
densityInputNuiDensityHow much room it takes: compact, regular or roomy.
showMethod() => voidOpens the calendar.

Customization inputs you leave unset follow the nearest data-nui-* attribute. See the customization guide.

NuiDateRangePicker

Two date fields with a range calendar. It takes the date picker’s inputs, and these.

Selector
nui-date-range-picker
NuiDateRangePicker: Properties
NameTypeDefaultDescription
valueTwo-wayNuiDateRange | nullnullThe range, or null until both ends are set, in order.
presetsInputNuiDateRangePreset[][]Named ranges to choose in one click.
monthsInputnumber2Months side by side in the calendar.

NuiDateRangePreset

A named range, fixed or made when chosen.

NuiDateRangePreset: Properties
NameTypeDefaultDescription
labelPropertystringIts name.
rangePropertyNuiDateRange | (() => NuiDateRange)The range, or a function that makes it.