# @salmonui/calendars/calendar API reference

> 30 exported symbols of @salmonui/calendars/calendar: 2 components, 5 functions, 14 interfaces and 9 types.

Canonical: https://salmonui.dev/docs/reference/calendars/calendar

```ts
import { … } from '@salmonui/calendars/calendar';
```

## Components

### Calendar

Kind: component

Page: https://salmonui.dev/docs/reference/calendars/calendar/Calendar

```ts
function Calendar(props: CalendarProps): import("react").JSX.Element;
```

An inline calendar: one month grid (or year / decade grid) with single or
multiple day selection (`selectionMode`). WAI-ARIA APG date grid.

### RangeCalendar

Kind: component

Page: https://salmonui.dev/docs/reference/calendars/calendar/RangeCalendar

```ts
function RangeCalendar(props: RangeCalendarProps): import("react").JSX.Element;
```

An inline calendar that selects a start and an end date.

Props: [`RangeCalendarProps`](https://salmonui.dev/docs/reference/calendars/calendar/RangeCalendarProps) (its members are the props)

## Functions

### getRangeDays

Kind: function

Page: https://salmonui.dev/docs/reference/calendars/calendar/getRangeDays

```ts
function getRangeDays(range: DateRange<PlainDateLike> | null | undefined): number;
```

Inclusive number of days of a range; 0 for null.

### toDate

Kind: function

Page: https://salmonui.dev/docs/reference/calendars/calendar/toDate

```ts
function toDate(value: PlainDateLike & Partial<PlainTimeLike>, timeZone?: string): Date;
```

The `Date` (instant) of a plain date or date-time: its wall time in
`timeZone` (DST resolved like Temporal `'compatible'`), else in the host
zone. An invalid value or zone gives an invalid `Date`.

### toPlainDate

Kind: function

Page: https://salmonui.dev/docs/reference/calendars/calendar/toPlainDate

```ts
function toPlainDate(input: unknown, timeZone?: string): PlainDate | null;
```

Normalizes a `DateInput` (an invalid input is null; never throws).

### toPlainDateTime

Kind: function

Page: https://salmonui.dev/docs/reference/calendars/calendar/toPlainDateTime

```ts
function toPlainDateTime(input: unknown, timeZone?: string): PlainDateTime | null;
```

Normalizes a `DateTimeInput`; a date-only input is midnight.

### toPlainTime

Kind: function

Page: https://salmonui.dev/docs/reference/calendars/calendar/toPlainTime

```ts
function toPlainTime(input: unknown, timeZone?: string): PlainTime | null;
```

Normalizes a `TimeInput`; a date-time input keeps its time part.

## Interfaces

### CalendarBaseProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarBaseProps

```ts
interface CalendarBaseProps extends DivProps {
    readonly ref?: Ref<HTMLDivElement>;
    readonly granularity?: CalendarGranularity;
    readonly view?: CalendarView;
    readonly defaultView?: CalendarView;
    readonly onViewChange?: (view: CalendarView) => void;
    readonly minView?: CalendarView;
    readonly maxView?: CalendarView;
    readonly focusedValue?: DateInput | null;
    readonly defaultFocusedValue?: DateInput;
    readonly onFocusedValueChange?: (date: PlainDate) => void;
    readonly min?: DateInput;
    readonly max?: DateInput;
    readonly isDateDisabled?: (date: PlainDate) => boolean;
    readonly renderDay?: (ctx: CalendarDayContext) => ReactNode;
    readonly getDayProps?: (ctx: CalendarDayContext) => CalendarDayProps | undefined;
    readonly firstDayOfWeek?: number;
    readonly showWeekNumbers?: boolean;
    readonly weekRule?: WeekRule;
    readonly weekdayFormat?: WeekdayFormat;
    readonly calendar?: string;
    readonly locale?: string;
    readonly timeZone?: string;
    readonly showTodayButton?: boolean;
    readonly showOutsideDays?: boolean;
    readonly disabled?: boolean;
    readonly readOnly?: boolean;
    readonly localeText?: Partial<CalendarLocaleText>;
    readonly dir?: 'ltr' | 'rtl';
}
```

Props shared by `Calendar` and `RangeCalendar`.

Members (28):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `ref` | `readonly ref?: Ref<HTMLDivElement>;` | optional |  |
| `granularity` | `readonly granularity?: CalendarGranularity;` | optional | Deepest selectable unit; also the deepest view (`'month'` makes a month picker). Default `'day'`. |
| `view` | `readonly view?: CalendarView;` | optional |  |
| `defaultView` | `readonly defaultView?: CalendarView;` | optional |  |
| `onViewChange` | `readonly onViewChange?: (view: CalendarView) => void;` | optional |  |
| `minView` | `readonly minView?: CalendarView;` | optional | Deepest view the user can navigate to. Default: from `granularity`. |
| `maxView` | `readonly maxView?: CalendarView;` | optional | Highest view the heading button can reach. Default `'decade'`. |
| `focusedValue` | `readonly focusedValue?: DateInput \| null;` | optional | The date the calendar shows and focuses. |
| `defaultFocusedValue` | `readonly defaultFocusedValue?: DateInput;` | optional |  |
| `onFocusedValueChange` | `readonly onFocusedValueChange?: (date: PlainDate) => void;` | optional |  |
| `min` | `readonly min?: DateInput;` | optional | Earliest selectable date (unbounded by default). |
| `max` | `readonly max?: DateInput;` | optional | Latest selectable date (unbounded by default). |
| `isDateDisabled` | `readonly isDateDisabled?: (date: PlainDate) => boolean;` | optional | Disables single days (weekends, holidays); disabled days stay focusable. |
| `renderDay` | `readonly renderDay?: (ctx: CalendarDayContext) => ReactNode;` | optional | Content of a day cell; the default is the day number. |
| `getDayProps` | `readonly getDayProps?: (ctx: CalendarDayContext) => CalendarDayProps \| undefined;` | optional | Extra `className`, `style`, `title` and `data-*` for a day cell. |
| `firstDayOfWeek` | `readonly firstDayOfWeek?: number;` | optional | 0 Sunday ... 6 Saturday. Default: the locale's week info. |
| `showWeekNumbers` | `readonly showWeekNumbers?: boolean;` | optional |  |
| `weekRule` | `readonly weekRule?: WeekRule;` | optional | Which week of January is week 1. Default: the locale's minimal days. |
| `weekdayFormat` | `readonly weekdayFormat?: WeekdayFormat;` | optional | Weekday header width. Default `'short'`. |
| `calendar` | `readonly calendar?: string;` | optional | `Intl` calendar id (`'gregory'`, `'islamic-umalqura'`, `'japanese'`, ...). Default: the `-u-ca-` of `locale`, else Gregorian. |
| `locale` | `readonly locale?: string;` | optional | BCP 47 locale. Default `'en-US'`; the host locale is never read. |
| `timeZone` | `readonly timeZone?: string;` | optional | IANA zone for `Date` and offset inputs and for today. Default: the host zone on the client only. |
| `showTodayButton` | `readonly showTodayButton?: boolean;` | optional |  |
| `showOutsideDays` | `readonly showOutsideDays?: boolean;` | optional | Show the days of the previous and next month. Default `false`. |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `localeText` | `readonly localeText?: Partial<CalendarLocaleText>;` | optional |  |
| `dir` | `readonly dir?: 'ltr' \| 'rtl';` | optional | Direction override; inherited from the document by default. |

### CalendarChangeDetails

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarChangeDetails

```ts
interface CalendarChangeDetails {
    readonly source: 'pointer' | 'keyboard' | 'api';
    readonly reason: 'select' | 'today';
    readonly iso: string;
}
```

Second argument of the change callbacks.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: 'pointer' \| 'keyboard' \| 'api';` |  |  |
| `reason` | `readonly reason: 'select' \| 'today';` |  |  |
| `iso` | `readonly iso: string;` |  | The ISO form value: `YYYY-MM-DD`, `start/end` for a range, comma separated for multiple dates, `''` for none. |

### CalendarDayContext

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarDayContext

```ts
interface CalendarDayContext {
    readonly date: PlainDate;
    readonly selected: boolean;
    readonly disabled: boolean;
    readonly outside: boolean;
    readonly today: boolean;
    readonly focused: boolean;
    readonly inRange: boolean;
    readonly rangeStart: boolean;
    readonly rangeEnd: boolean;
}
```

State of one rendered day cell, passed to `renderDay` and `getDayProps`.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `date` | `readonly date: PlainDate;` |  |  |
| `selected` | `readonly selected: boolean;` |  |  |
| `disabled` | `readonly disabled: boolean;` |  |  |
| `outside` | `readonly outside: boolean;` |  | A day of the previous or next month (rendered only with `showOutsideDays`). |
| `today` | `readonly today: boolean;` |  | Today in the calendar's time zone; always false in server HTML. |
| `focused` | `readonly focused: boolean;` |  |  |
| `inRange` | `readonly inRange: boolean;` |  | Inside the selected or previewed range (RangeCalendar). |
| `rangeStart` | `readonly rangeStart: boolean;` |  |  |
| `rangeEnd` | `readonly rangeEnd: boolean;` |  |  |

### CalendarDayProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarDayProps

```ts
interface CalendarDayProps {
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly title?: string;
    readonly [data: `data-${string}`]: string | number | boolean | undefined;
}
```

Props `getDayProps` may add to a day cell.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |
| `title` | `readonly title?: string;` | optional |  |

### CalendarLocaleText

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarLocaleText

```ts
interface CalendarLocaleText {
    readonly previousMonth: LocaleMessage;
    readonly nextMonth: LocaleMessage;
    readonly previousYear: LocaleMessage;
    readonly nextYear: LocaleMessage;
    readonly previousDecade: LocaleMessage;
    readonly nextDecade: LocaleMessage;
    readonly today: LocaleMessage;
    readonly weekNumber: LocaleMessage;
    readonly weekNumberHeader: LocaleMessage;
    readonly weekNumberLabel: LocaleMessage;
    readonly rangeStartSelected: LocaleMessage;
    readonly selectedRange: LocaleMessage;
}
```

User-visible strings of `Calendar` and `RangeCalendar` (Data Grid `localeText` message format).

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `previousMonth` | `readonly previousMonth: LocaleMessage;` |  |  |
| `nextMonth` | `readonly nextMonth: LocaleMessage;` |  |  |
| `previousYear` | `readonly previousYear: LocaleMessage;` |  |  |
| `nextYear` | `readonly nextYear: LocaleMessage;` |  |  |
| `previousDecade` | `readonly previousDecade: LocaleMessage;` |  |  |
| `nextDecade` | `readonly nextDecade: LocaleMessage;` |  |  |
| `today` | `readonly today: LocaleMessage;` |  |  |
| `weekNumber` | `readonly weekNumber: LocaleMessage;` |  | Week number column header. |
| `weekNumberHeader` | `readonly weekNumberHeader: LocaleMessage;` |  | Full name of the week number column (`abbr` of its header). |
| `weekNumberLabel` | `readonly weekNumberLabel: LocaleMessage;` |  | Accessible name of a week number row header (`{week}`). |
| `rangeStartSelected` | `readonly rangeStartSelected: LocaleMessage;` |  | Announced when a range start is chosen (`{date}`). |
| `selectedRange` | `readonly selectedRange: LocaleMessage;` |  | Announced when a range is complete (`{start}`, `{end}`, `{count}`; plural forms). |

### CalendarMultipleProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarMultipleProps

```ts
interface CalendarMultipleProps extends CalendarBaseProps {
    readonly selectionMode: 'multiple';
    readonly value?: readonly DateInput[];
    readonly defaultValue?: readonly DateInput[];
    readonly onValueChange?: (value: PlainDate[], details: CalendarChangeDetails) => void;
}
```

Members (32):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `selectionMode` | `readonly selectionMode: 'multiple';` |  |  |
| `value` | `readonly value?: readonly DateInput[];` | optional |  |
| `defaultValue` | `readonly defaultValue?: readonly DateInput[];` | optional |  |
| `onValueChange` | `readonly onValueChange?: (value: PlainDate[], details: CalendarChangeDetails) => void;` | optional |  |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional, inherited |  |
| `granularity` | `granularity?: CalendarGranularity;` | optional, inherited | Deepest selectable unit; also the deepest view (`'month'` makes a month picker). Default `'day'`. |
| `view` | `view?: CalendarView;` | optional, inherited |  |
| `defaultView` | `defaultView?: CalendarView;` | optional, inherited |  |
| `onViewChange` | `onViewChange?: ((view: CalendarView) => void);` | optional, inherited |  |
| `minView` | `minView?: CalendarView;` | optional, inherited | Deepest view the user can navigate to. Default: from `granularity`. |
| `maxView` | `maxView?: CalendarView;` | optional, inherited | Highest view the heading button can reach. Default `'decade'`. |
| `focusedValue` | `focusedValue?: DateInput \| null;` | optional, inherited | The date the calendar shows and focuses. |
| `defaultFocusedValue` | `defaultFocusedValue?: DateInput;` | optional, inherited |  |
| `onFocusedValueChange` | `onFocusedValueChange?: ((date: PlainDate) => void);` | optional, inherited |  |
| `min` | `min?: DateInput;` | optional, inherited | Earliest selectable date (unbounded by default). |
| `max` | `max?: DateInput;` | optional, inherited | Latest selectable date (unbounded by default). |
| `isDateDisabled` | `isDateDisabled?: ((date: PlainDate) => boolean);` | optional, inherited | Disables single days (weekends, holidays); disabled days stay focusable. |
| `renderDay` | `renderDay?: ((ctx: CalendarDayContext) => ReactNode);` | optional, inherited | Content of a day cell; the default is the day number. |
| `getDayProps` | `getDayProps?: ((ctx: CalendarDayContext) => CalendarDayProps \| undefined);` | optional, inherited | Extra `className`, `style`, `title` and `data-*` for a day cell. |
| `firstDayOfWeek` | `firstDayOfWeek?: number;` | optional, inherited | 0 Sunday ... 6 Saturday. Default: the locale's week info. |
| `showWeekNumbers` | `showWeekNumbers?: boolean;` | optional, inherited |  |
| `weekRule` | `weekRule?: WeekRule;` | optional, inherited | Which week of January is week 1. Default: the locale's minimal days. |
| `weekdayFormat` | `weekdayFormat?: WeekdayFormat;` | optional, inherited | Weekday header width. Default `'short'`. |
| `calendar` | `calendar?: string;` | optional, inherited | `Intl` calendar id (`'gregory'`, `'islamic-umalqura'`, `'japanese'`, ...). Default: the `-u-ca-` of `locale`, else Gregorian. |
| `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 for today. Default: the host zone on the client only. |
| `showTodayButton` | `showTodayButton?: boolean;` | optional, inherited |  |
| `showOutsideDays` | `showOutsideDays?: boolean;` | optional, inherited | Show the days of the previous and next month. Default `false`. |
| `disabled` | `disabled?: boolean;` | optional, inherited |  |
| `readOnly` | `readOnly?: boolean;` | optional, inherited |  |
| `localeText` | `localeText?: Partial<CalendarLocaleText>;` | optional, inherited |  |
| `dir` | `dir?: "ltr" \| "rtl";` | optional, inherited | Direction override; inherited from the document by default. |

### CalendarSingleProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarSingleProps

```ts
interface CalendarSingleProps extends CalendarBaseProps {
    readonly selectionMode?: 'single';
    readonly value?: DateInput | null;
    readonly defaultValue?: DateInput | null;
    readonly onValueChange?: (value: PlainDate | null, details: CalendarChangeDetails) => void;
}
```

Members (32):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `selectionMode` | `readonly selectionMode?: 'single';` | optional |  |
| `value` | `readonly value?: DateInput \| null;` | optional |  |
| `defaultValue` | `readonly defaultValue?: DateInput \| null;` | optional |  |
| `onValueChange` | `readonly onValueChange?: (value: PlainDate \| null, details: CalendarChangeDetails) => void;` | optional |  |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional, inherited |  |
| `granularity` | `granularity?: CalendarGranularity;` | optional, inherited | Deepest selectable unit; also the deepest view (`'month'` makes a month picker). Default `'day'`. |
| `view` | `view?: CalendarView;` | optional, inherited |  |
| `defaultView` | `defaultView?: CalendarView;` | optional, inherited |  |
| `onViewChange` | `onViewChange?: ((view: CalendarView) => void);` | optional, inherited |  |
| `minView` | `minView?: CalendarView;` | optional, inherited | Deepest view the user can navigate to. Default: from `granularity`. |
| `maxView` | `maxView?: CalendarView;` | optional, inherited | Highest view the heading button can reach. Default `'decade'`. |
| `focusedValue` | `focusedValue?: DateInput \| null;` | optional, inherited | The date the calendar shows and focuses. |
| `defaultFocusedValue` | `defaultFocusedValue?: DateInput;` | optional, inherited |  |
| `onFocusedValueChange` | `onFocusedValueChange?: ((date: PlainDate) => void);` | optional, inherited |  |
| `min` | `min?: DateInput;` | optional, inherited | Earliest selectable date (unbounded by default). |
| `max` | `max?: DateInput;` | optional, inherited | Latest selectable date (unbounded by default). |
| `isDateDisabled` | `isDateDisabled?: ((date: PlainDate) => boolean);` | optional, inherited | Disables single days (weekends, holidays); disabled days stay focusable. |
| `renderDay` | `renderDay?: ((ctx: CalendarDayContext) => ReactNode);` | optional, inherited | Content of a day cell; the default is the day number. |
| `getDayProps` | `getDayProps?: ((ctx: CalendarDayContext) => CalendarDayProps \| undefined);` | optional, inherited | Extra `className`, `style`, `title` and `data-*` for a day cell. |
| `firstDayOfWeek` | `firstDayOfWeek?: number;` | optional, inherited | 0 Sunday ... 6 Saturday. Default: the locale's week info. |
| `showWeekNumbers` | `showWeekNumbers?: boolean;` | optional, inherited |  |
| `weekRule` | `weekRule?: WeekRule;` | optional, inherited | Which week of January is week 1. Default: the locale's minimal days. |
| `weekdayFormat` | `weekdayFormat?: WeekdayFormat;` | optional, inherited | Weekday header width. Default `'short'`. |
| `calendar` | `calendar?: string;` | optional, inherited | `Intl` calendar id (`'gregory'`, `'islamic-umalqura'`, `'japanese'`, ...). Default: the `-u-ca-` of `locale`, else Gregorian. |
| `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 for today. Default: the host zone on the client only. |
| `showTodayButton` | `showTodayButton?: boolean;` | optional, inherited |  |
| `showOutsideDays` | `showOutsideDays?: boolean;` | optional, inherited | Show the days of the previous and next month. Default `false`. |
| `disabled` | `disabled?: boolean;` | optional, inherited |  |
| `readOnly` | `readOnly?: boolean;` | optional, inherited |  |
| `localeText` | `localeText?: Partial<CalendarLocaleText>;` | optional, inherited |  |
| `dir` | `dir?: "ltr" \| "rtl";` | optional, inherited | Direction override; inherited from the document by default. |

### DateRange

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/DateRange

```ts
interface DateRange<T = PlainDate> {
    readonly start: T;
    readonly end: T;
}
```

An inclusive range of two values.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `start` | `readonly start: T;` |  |  |
| `end` | `readonly end: T;` |  |  |

### PlainDate

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainDate

```ts
interface PlainDate extends PlainDateLike {
    toString(): string;
    toJSON(): string;
}
```

A frozen ISO calendar date. `String(date)` and `JSON.stringify` give `YYYY-MM-DD`.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `toString` | `toString(): string;` |  | Returns a string representation of an object. |
| `toJSON` | `toJSON(): string;` |  |  |
| `year` | `year: number;` | inherited |  |
| `month` | `month: number;` | inherited |  |
| `day` | `day: number;` | inherited |  |

### PlainDateLike

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainDateLike

```ts
interface PlainDateLike {
    readonly year: number;
    readonly month: number;
    readonly day: number;
}
```

Anything with ISO calendar date fields (`Temporal.PlainDate` included). Month is 1-12.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `year` | `readonly year: number;` |  |  |
| `month` | `readonly month: number;` |  |  |
| `day` | `readonly day: number;` |  |  |

### PlainDateTime

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainDateTime

```ts
interface PlainDateTime extends PlainDate, Omit<PlainTime, 'toString' | 'toJSON'> {
}
```

A frozen date and wall-clock time. `String(value)` gives `YYYY-MM-DDTHH:mm:ss`.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `year` | `year: number;` | inherited |  |
| `month` | `month: number;` | inherited |  |
| `day` | `day: number;` | inherited |  |
| `hour` | `hour: number;` | inherited |  |
| `minute` | `minute: number;` | inherited |  |
| `second` | `second: number;` | inherited |  |
| `millisecond` | `millisecond: number;` | inherited |  |
| `toString` | `toString: () => string;` | inherited | Returns a string representation of an object. |
| `toJSON` | `toJSON: () => string;` | inherited |  |

### PlainTime

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainTime

```ts
interface PlainTime extends Required<PlainTimeLike> {
    toString(): string;
    toJSON(): string;
}
```

A frozen wall-clock time. `String(time)` gives `HH:mm:ss` (`.sss` when milliseconds are set).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `toString` | `toString(): string;` |  | Returns a string representation of an object. |
| `toJSON` | `toJSON(): string;` |  |  |
| `hour` | `hour: number;` | inherited |  |
| `minute` | `minute: number;` | inherited |  |
| `second` | `second: number;` | inherited |  |
| `millisecond` | `millisecond: number;` | inherited |  |

### PlainTimeLike

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainTimeLike

```ts
interface PlainTimeLike {
    readonly hour: number;
    readonly minute: number;
    readonly second?: number;
    readonly millisecond?: number;
}
```

Anything with wall-clock time fields (`Temporal.PlainTime` included).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `hour` | `readonly hour: number;` |  |  |
| `minute` | `readonly minute: number;` |  |  |
| `second` | `readonly second?: number;` | optional |  |
| `millisecond` | `readonly millisecond?: number;` | optional |  |

### RangeCalendarProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/calendar/RangeCalendarProps

```ts
interface RangeCalendarProps extends CalendarBaseProps {
    readonly value?: DateRange<DateInput> | null;
    readonly defaultValue?: DateRange<DateInput> | null;
    readonly onValueChange?: (value: DateRange | null, details: CalendarChangeDetails) => void;
    readonly visibleMonths?: number;
    readonly minDays?: number;
    readonly maxDays?: number;
    readonly rangeOverDisabled?: 'block' | 'allow';
}
```

Members (35):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: DateRange<DateInput> \| null;` | optional |  |
| `defaultValue` | `readonly defaultValue?: DateRange<DateInput> \| null;` | optional |  |
| `onValueChange` | `readonly onValueChange?: (value: DateRange \| null, details: CalendarChangeDetails) => void;` | optional |  |
| `visibleMonths` | `readonly visibleMonths?: number;` | optional | Months shown side by side. Default 1. |
| `minDays` | `readonly minDays?: number;` | optional | Shortest allowed range in days (inclusive). |
| `maxDays` | `readonly maxDays?: number;` | optional | Longest allowed range in days (inclusive). |
| `rangeOverDisabled` | `readonly rangeOverDisabled?: 'block' \| 'allow';` | optional | `'block'` (default): a range may not span a disabled day. |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional, inherited |  |
| `granularity` | `granularity?: CalendarGranularity;` | optional, inherited | Deepest selectable unit; also the deepest view (`'month'` makes a month picker). Default `'day'`. |
| `view` | `view?: CalendarView;` | optional, inherited |  |
| `defaultView` | `defaultView?: CalendarView;` | optional, inherited |  |
| `onViewChange` | `onViewChange?: ((view: CalendarView) => void);` | optional, inherited |  |
| `minView` | `minView?: CalendarView;` | optional, inherited | Deepest view the user can navigate to. Default: from `granularity`. |
| `maxView` | `maxView?: CalendarView;` | optional, inherited | Highest view the heading button can reach. Default `'decade'`. |
| `focusedValue` | `focusedValue?: DateInput \| null;` | optional, inherited | The date the calendar shows and focuses. |
| `defaultFocusedValue` | `defaultFocusedValue?: DateInput;` | optional, inherited |  |
| `onFocusedValueChange` | `onFocusedValueChange?: ((date: PlainDate) => void);` | optional, inherited |  |
| `min` | `min?: DateInput;` | optional, inherited | Earliest selectable date (unbounded by default). |
| `max` | `max?: DateInput;` | optional, inherited | Latest selectable date (unbounded by default). |
| `isDateDisabled` | `isDateDisabled?: ((date: PlainDate) => boolean);` | optional, inherited | Disables single days (weekends, holidays); disabled days stay focusable. |
| `renderDay` | `renderDay?: ((ctx: CalendarDayContext) => ReactNode);` | optional, inherited | Content of a day cell; the default is the day number. |
| `getDayProps` | `getDayProps?: ((ctx: CalendarDayContext) => CalendarDayProps \| undefined);` | optional, inherited | Extra `className`, `style`, `title` and `data-*` for a day cell. |
| `firstDayOfWeek` | `firstDayOfWeek?: number;` | optional, inherited | 0 Sunday ... 6 Saturday. Default: the locale's week info. |
| `showWeekNumbers` | `showWeekNumbers?: boolean;` | optional, inherited |  |
| `weekRule` | `weekRule?: WeekRule;` | optional, inherited | Which week of January is week 1. Default: the locale's minimal days. |
| `weekdayFormat` | `weekdayFormat?: WeekdayFormat;` | optional, inherited | Weekday header width. Default `'short'`. |
| `calendar` | `calendar?: string;` | optional, inherited | `Intl` calendar id (`'gregory'`, `'islamic-umalqura'`, `'japanese'`, ...). Default: the `-u-ca-` of `locale`, else Gregorian. |
| `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 for today. Default: the host zone on the client only. |
| `showTodayButton` | `showTodayButton?: boolean;` | optional, inherited |  |
| `showOutsideDays` | `showOutsideDays?: boolean;` | optional, inherited | Show the days of the previous and next month. Default `false`. |
| `disabled` | `disabled?: boolean;` | optional, inherited |  |
| `readOnly` | `readOnly?: boolean;` | optional, inherited |  |
| `localeText` | `localeText?: Partial<CalendarLocaleText>;` | optional, inherited |  |
| `dir` | `dir?: "ltr" \| "rtl";` | optional, inherited | Direction override; inherited from the document by default. |

## Types

### CalendarGranularity

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarGranularity

```ts
type CalendarGranularity = 'day' | 'month' | 'year';
```

What a calendar selects: days, months (day 1) or years (January 1).

### CalendarProps

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarProps

```ts
type CalendarProps = CalendarSingleProps | CalendarMultipleProps;
```

### CalendarView

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/CalendarView

```ts
type CalendarView = 'month' | 'year' | 'decade';
```

Navigation view of a calendar: days of a month, months of a year, years of a decade.

### DateInput

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/DateInput

```ts
type DateInput = PlainDateLike | Date | string;
```

A date value: fields, a `Date` (an instant, read in the time zone) or an ISO 8601 string (`'2026-11-23'`).

### DateTimeInput

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/DateTimeInput

```ts
type DateTimeInput = PlainDateTimeLike | Date | string;
```

A date-time value: fields, a `Date` or an ISO date-time string (`'2026-11-23T14:30'`).

### PlainDateTimeLike

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/PlainDateTimeLike

```ts
type PlainDateTimeLike = PlainDateLike & PlainTimeLike;
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `year` | `year: number;` | inherited |  |
| `month` | `month: number;` | inherited |  |
| `day` | `day: number;` | inherited |  |
| `hour` | `hour: number;` | inherited |  |
| `minute` | `minute: number;` | inherited |  |
| `second` | `second?: number;` | optional, inherited |  |
| `millisecond` | `millisecond?: number;` | optional, inherited |  |

### TimeInput

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/TimeInput

```ts
type TimeInput = PlainTimeLike | Date | string;
```

A time value: fields, a `Date` or an ISO time string (`'14:30'`, `'14:30:05'`).

### WeekRule

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/WeekRule

```ts
type WeekRule = 'firstDay' | 'firstFullWeek' | 'firstFourDayWeek';
```

Which week of January is week 1.

### WeekdayFormat

Kind: type

Page: https://salmonui.dev/docs/reference/calendars/calendar/WeekdayFormat

```ts
type WeekdayFormat = 'narrow' | 'short' | 'long';
```
