API reference: @salmonui/calendars/date-field
DateFieldDateTimePropsinterface
import type { DateFieldDateTimeProps } from '@salmonui/calendars/date-field';Also exported from @salmonui/calendars/date-picker.
interface DateFieldDateTimeProps extends DateFieldShared {
readonly granularity: 'hour' | 'minute' | 'second';
readonly value?: DateTimeInput | null;
readonly defaultValue?: DateTimeInput | null;
readonly onValueChange?: (value: PlainDateTime | null, details: FieldChangeDetails) => void;
readonly isDateDisabled?: (date: PlainDateTime) => boolean;
}
A date-time field: granularity 'hour' | 'minute' | 'second'; values are PlainDateTime.
| Name | Signature | Description |
|---|---|---|
refoptionalinherited | ref?: Ref<HTMLDivElement>; | |
sizeoptionalinherited | size?: "lg" | "md" | "sm"; | Control size: |
granularity | readonly granularity: 'hour' | 'minute' | 'second'; | |
valueoptional | readonly value?: DateTimeInput | null; | |
defaultValueoptional | readonly defaultValue?: DateTimeInput | null; | |
onValueChangeoptional | readonly onValueChange?: (value: PlainDateTime | null, details: FieldChangeDetails) => void; | |
isDateDisabledoptional | readonly isDateDisabled?: (date: PlainDateTime) => boolean; | |
labeloptionalinherited | label?: ReactNode; | Visible label above the segments; also names the group. |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ReactNode; | Shown when |
formatoptionalinherited | format?: DateFormat; | Display format: |
hourCycleoptionalinherited | hourCycle?: HourCycle; |
|
localeoptionalinherited | locale?: string; | BCP 47 locale. Default |
timeZoneoptionalinherited | timeZone?: string; | IANA zone for |
inputFormatsoptionalinherited | inputFormats?: readonly string[]; | Extra accepted paste and typed formats (patterns); ISO is always accepted. |
parseoptionalinherited | parse?: ParseFn; | Custom text parser, tried last. |
strictoptionalinherited | strict?: boolean; |
|
disabledoptionalinherited | disabled?: boolean; | |
readOnlyoptionalinherited | readOnly?: boolean; | |
requiredoptionalinherited | required?: boolean; | |
invalidoptionalinherited | invalid?: boolean; | |
autoFocusoptionalinherited | autoFocus?: boolean; | |
nameoptionalinherited | name?: string; | Form field name: a visually hidden input posts the ISO value. |
formoptionalinherited | form?: string; | |
onFocusoptionalinherited | onFocus?: ((event: FocusEvent<HTMLDivElement, Element>) => void); | Fires once when focus enters the group. |
onBluroptionalinherited | onBlur?: ((event: FocusEvent<HTMLDivElement, Element>) => void); | Fires once when focus leaves the group. |
localeTextoptionalinherited | localeText?: Partial<FieldLocaleText>; | |
diroptionalinherited | dir?: "ltr" | "rtl"; | Direction override; inherited from the document by default. |
minoptionalinherited | min?: DateInput; | Earliest valid value. |
maxoptionalinherited | max?: DateInput; | Latest valid value. |
placeholderValueoptionalinherited | placeholderValue?: DateInput; | Seeds Up / Down on empty segments (default: now, read in the event handler). |