# DateFieldDateProps (@salmonui/calendars/date-field)

> The DateFieldDateProps interface of @salmonui/calendars/date-field: A date field: granularity 'year' | 'month' | 'day' (default 'day'); values are PlainDate.

Canonical: https://salmonui.dev/docs/reference/calendars/date-field/DateFieldDateProps

```ts
import type { DateFieldDateProps } from '@salmonui/calendars/date-field';
```

Also exported from `@salmonui/calendars/date-picker`.

Entry index: https://salmonui.dev/docs/reference/calendars/date-field (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/calendars/date-field.md).

## Reference

Kind: interface

```ts
interface DateFieldDateProps extends DateFieldShared {
    readonly granularity?: 'year' | 'month' | 'day';
    readonly value?: DateInput | null;
    readonly defaultValue?: DateInput | null;
    readonly onValueChange?: (value: PlainDate | null, details: FieldChangeDetails) => void;
    readonly isDateDisabled?: (date: PlainDate) => boolean;
}
```

A date field: `granularity` `'year' | 'month' | 'day'` (default `'day'`); values are `PlainDate`.

Members (31):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `granularity` | `readonly granularity?: 'year' \| 'month' \| 'day';` | optional |  |
| `value` | `readonly value?: DateInput \| null;` | optional |  |
| `defaultValue` | `readonly defaultValue?: DateInput \| null;` | optional |  |
| `onValueChange` | `readonly onValueChange?: (value: PlainDate \| null, details: FieldChangeDetails) => void;` | optional |  |
| `isDateDisabled` | `readonly isDateDisabled?: (date: PlainDate) => boolean;` | optional | Rejects single dates (the field becomes invalid). |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional, inherited |  |
| `size` | `size?: "lg" \| "md" \| "sm";` | optional, inherited | Control size: `'sm'` 24px, `'md'` 32px (default), `'lg'` 40px tall; `data-size` on the group. |
| `label` | `label?: ReactNode;` | optional, inherited | Visible label above the segments; also names the group. |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ReactNode;` | optional, inherited | Shown when `invalid` (or a complete value is out of range / disabled). |
| `format` | `format?: DateFormat;` | optional, inherited | Display format: `Intl` options, a CLDR skeleton (`'yMMMd'`) or a pattern (`'dd/MM/yyyy'`, `'HH:mm'`); the segments follow it. |
| `hourCycle` | `hourCycle?: HourCycle;` | optional, inherited | `'h12'` or `'h23'`; default from the locale. |
| `locale` | `locale?: string;` | optional, inherited | BCP 47 locale. Default `'en-US'`; the host locale is never read. |
| `timeZone` | `timeZone?: string;` | optional, inherited | IANA zone for `Date` and offset inputs, and `details.epochMilliseconds`. |
| `inputFormats` | `inputFormats?: readonly string[];` | optional, inherited | Extra accepted paste and typed formats (patterns); ISO is always accepted. |
| `parse` | `parse?: ParseFn;` | optional, inherited | Custom text parser, tried last. |
| `strict` | `strict?: boolean;` | optional, inherited | `false` (default): an out-of-range or disabled value is kept and the field is `aria-invalid`. `true`: on blur, incomplete or disabled input reverts to the last valid value and an out-of-range value moves to the nearest bound. |
| `disabled` | `disabled?: boolean;` | optional, inherited |  |
| `readOnly` | `readOnly?: boolean;` | optional, inherited |  |
| `required` | `required?: boolean;` | optional, inherited |  |
| `invalid` | `invalid?: boolean;` | optional, inherited |  |
| `autoFocus` | `autoFocus?: boolean;` | optional, inherited |  |
| `name` | `name?: string;` | optional, inherited | Form field name: a visually hidden input posts the ISO value. |
| `form` | `form?: string;` | optional, inherited |  |
| `onFocus` | `onFocus?: ((event: FocusEvent<HTMLDivElement, Element>) => void);` | optional, inherited | Fires once when focus enters the group. |
| `onBlur` | `onBlur?: ((event: FocusEvent<HTMLDivElement, Element>) => void);` | optional, inherited | Fires once when focus leaves the group. |
| `localeText` | `localeText?: Partial<FieldLocaleText>;` | optional, inherited |  |
| `dir` | `dir?: "ltr" \| "rtl";` | optional, inherited | Direction override; inherited from the document by default. |
| `min` | `min?: DateInput;` | optional, inherited | Earliest valid value. |
| `max` | `max?: DateInput;` | optional, inherited | Latest valid value. |
| `placeholderValue` | `placeholderValue?: DateInput;` | optional, inherited | Seeds Up / Down on empty segments (default: now, read in the event handler). |
