View as Markdown

API reference: @salmonui/calendars/calendar

RangeCalendarPropsinterface

import type { RangeCalendarProps } from '@salmonui/calendars/calendar';
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';
}
RangeCalendarProps members (35, 28 inherited)
NameSignatureDescription
valueoptionalreadonly value?: DateRange<DateInput> | null;
defaultValueoptionalreadonly defaultValue?: DateRange<DateInput> | null;
onValueChangeoptionalreadonly onValueChange?: (value: DateRange | null, details: CalendarChangeDetails) => void;
visibleMonthsoptionalreadonly visibleMonths?: number;

Months shown side by side. Default 1.

minDaysoptionalreadonly minDays?: number;

Shortest allowed range in days (inclusive).

maxDaysoptionalreadonly maxDays?: number;

Longest allowed range in days (inclusive).

rangeOverDisabledoptionalreadonly rangeOverDisabled?: 'block' | 'allow';

'block' (default): a range may not span a disabled day.

refoptionalinheritedref?: Ref<HTMLDivElement>;
granularityoptionalinheritedgranularity?: CalendarGranularity;

Deepest selectable unit; also the deepest view ('month' makes a month picker). Default 'day'.

viewoptionalinheritedview?: CalendarView;
defaultViewoptionalinheriteddefaultView?: CalendarView;
onViewChangeoptionalinheritedonViewChange?: ((view: CalendarView) => void);
minViewoptionalinheritedminView?: CalendarView;

Deepest view the user can navigate to. Default: from granularity.

maxViewoptionalinheritedmaxView?: CalendarView;

Highest view the heading button can reach. Default 'decade'.

focusedValueoptionalinheritedfocusedValue?: DateInput | null;

The date the calendar shows and focuses.

defaultFocusedValueoptionalinheriteddefaultFocusedValue?: DateInput;
onFocusedValueChangeoptionalinheritedonFocusedValueChange?: ((date: PlainDate) => void);
minoptionalinheritedmin?: DateInput;

Earliest selectable date (unbounded by default).

maxoptionalinheritedmax?: DateInput;

Latest selectable date (unbounded by default).

isDateDisabledoptionalinheritedisDateDisabled?: ((date: PlainDate) => boolean);

Disables single days (weekends, holidays); disabled days stay focusable.

renderDayoptionalinheritedrenderDay?: ((ctx: CalendarDayContext) => ReactNode);

Content of a day cell; the default is the day number.

getDayPropsoptionalinheritedgetDayProps?: ((ctx: CalendarDayContext) => CalendarDayProps | undefined);

Extra className, style, title and data-* for a day cell.

firstDayOfWeekoptionalinheritedfirstDayOfWeek?: number;

0 Sunday ... 6 Saturday. Default: the locale's week info.

showWeekNumbersoptionalinheritedshowWeekNumbers?: boolean;
weekRuleoptionalinheritedweekRule?: WeekRule;

Which week of January is week 1. Default: the locale's minimal days.

weekdayFormatoptionalinheritedweekdayFormat?: WeekdayFormat;

Weekday header width. Default 'short'.

calendaroptionalinheritedcalendar?: string;

Intl calendar id ('gregory', 'islamic-umalqura', 'japanese', ...). Default: the -u-ca- of locale, else Gregorian.

localeoptionalinheritedlocale?: string;

BCP 47 locale. Default 'en-US'; the host locale is never read.

timeZoneoptionalinheritedtimeZone?: string;

IANA zone for Date and offset inputs and for today. Default: the host zone on the client only.

showTodayButtonoptionalinheritedshowTodayButton?: boolean;
showOutsideDaysoptionalinheritedshowOutsideDays?: boolean;

Show the days of the previous and next month. Default false.

disabledoptionalinheriteddisabled?: boolean;
readOnlyoptionalinheritedreadOnly?: boolean;
localeTextoptionalinheritedlocaleText?: Partial<CalendarLocaleText>;
diroptionalinheriteddir?: "ltr" | "rtl";

Direction override; inherited from the document by default.