Import
import {
NuiDateField,
NuiDatePicker,
NuiDateRangePicker,
NuiTimeField,
} from '@needless-ui/angular/date-picker';NuiDateField
A date, or a date and time, typed in segments.
| Name | Type | Default | Description |
|---|---|---|---|
valueTwo-way | NuiDate | NuiDateTime | null | null | The 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, maxInput | string | null | The earliest and latest values. Outside them, the field is invalid. | |
placeholderInput | string | null | now | Where empty segments start from with the arrow keys. |
hourCycleInput | 12 | 24 | A 12- or 24-hour clock. By default, the locale’s. | |
minuteStepInput | number | 1 | How far the arrow keys move the minutes. |
disabled, readonlyInput | boolean | false | Stop changes. |
localeInput | string | LOCALE_ID | Sets the order, separators, digits and clock. |
labelsInput | Partial<NuiDateFieldLabels> | Every text the field says, to translate. | |
invalidProperty | Signal<boolean> | Whether the value is outside min and max. | |
focusMethod | () => void | Focuses the first empty segment. |
NuiTimeField
A time of day typed in segments. It takes the same inputs as the date field.
| Name | Type | Default | Description |
|---|---|---|---|
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.
| Name | Type | Default | Description |
|---|---|---|---|
unavailableInput | (date: NuiDate) => boolean | Days the calendar won’t pick. | |
firstDay, weekNumbersInput | 1 … 7, boolean | Passed to the calendar. | |
labelsInput | Partial<NuiDatePickerLabels> | The texts of the field, the button and the calendar. | |
cornersInput | NuiCorners | The shape of its corners: round, squircle, bevel, scoop, notch or square. | |
radiusInput | NuiRadius | How big its corners are: none, small, medium, large or full. | |
densityInput | NuiDensity | How much room it takes: compact, regular or roomy. | |
showMethod | () => void | Opens 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.
| Name | Type | Default | Description |
|---|---|---|---|
valueTwo-way | NuiDateRange | null | null | The range, or null until both ends are set, in order. |
presetsInput | NuiDateRangePreset[] | [] | Named ranges to choose in one click. |
monthsInput | number | 2 | Months side by side in the calendar. |
NuiDateRangePreset
A named range, fixed or made when chosen.
| Name | Type | Default | Description |
|---|---|---|---|
labelProperty | string | Its name. | |
rangeProperty | NuiDateRange | (() => NuiDateRange) | The range, or a function that makes it. |