Circle V2 API Docs
    Preparing search index...
    interface UseDatePickerContext {
        clearValue: (options?: { focus?: boolean }) => void;
        disabled: boolean;
        focused: boolean;
        focusedValue: DateValue;
        focusedValueAsDate: Date;
        focusedValueAsString: string;
        focusMonth: (month: number) => void;
        focusYear: (year: number) => void;
        format: (value: DateValue, opts?: DateTimeFormatOptions) => string;
        getClearTriggerProps: () => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getContentProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getControlProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getDaysInWeek: (week: number, from?: DateValue) => DateValue[];
        getDayTableCellProps: (
            props: DayTableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getDayTableCellState: (props: DayTableCellProps) => DayTableCellState;
        getDayTableCellTriggerProps: (
            props: DayTableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getDecade: () => Range<number | undefined>;
        getInputProps: (
            props?: InputProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                InputHTMLAttributes<HTMLInputElement>,
                HTMLInputElement,
            >,
        >;
        getLabelProps: (
            props?: LabelProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                LabelHTMLAttributes<HTMLLabelElement>,
                HTMLLabelElement,
            >,
        >;
        getMonths: (props?: MonthFormatOptions) => Cell[];
        getMonthSelectProps: () => WithoutRef<
            DetailedHTMLProps<
                SelectHTMLAttributes<HTMLSelectElement>,
                HTMLSelectElement,
            >,
        >;
        getMonthsGrid: (props?: MonthGridProps) => MonthGridValue;
        getMonthTableCellProps: (
            props: TableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getMonthTableCellState: (props: TableCellProps) => TableCellState;
        getMonthTableCellTriggerProps: (
            props: TableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getMonthWeeks: (from?: DateValue) => DateValue[][];
        getNextTriggerProps: (
            props?: ViewProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getOffset: (duration: DateDuration) => DateValueOffset;
        getPositionerProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getPresetTriggerProps: (
            props: PresetTriggerProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getPrevTriggerProps: (
            props?: ViewProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getRangePresetValue: (value: DatePicker.DateRangePreset) => DateValue[];
        getRangeTextProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getRootProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTableBodyProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTableHeaderProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTableHeadProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTableProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTableRowProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTriggerProps: () => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getViewControlProps: (
            props?: ViewProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getViewProps: (
            props?: ViewProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getViewTriggerProps: (
            props?: ViewProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getWeekNumber: (week: DateValue[]) => number;
        getWeekNumberCellProps: (
            props: WeekNumberCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getWeekNumberHeaderCellProps: (
            props?: TableProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getYears: () => Cell[];
        getYearSelectProps: () => WithoutRef<
            DetailedHTMLProps<
                SelectHTMLAttributes<HTMLSelectElement>,
                HTMLSelectElement,
            >,
        >;
        getYearsGrid: (props?: YearGridProps) => YearGridValue;
        getYearTableCellProps: (
            props: TableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getYearTableCellState: (props: TableCellProps) => TableCellState;
        getYearTableCellTriggerProps: (
            props: TableCellProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        goToNext: VoidFunction;
        goToPrev: VoidFunction;
        inline: boolean;
        invalid: boolean;
        isMaxSelected: boolean;
        isUnavailable: (date: DateValue) => boolean;
        maxSelectedDates: number | undefined;
        numOfMonths: number;
        open: boolean;
        readOnly: boolean;
        selectionMode: SelectionMode;
        selectToday: VoidFunction;
        setFocusedValue: (value: DateValue) => void;
        setOpen: (open: boolean) => void;
        setTime: (time: Time, index?: number) => void;
        setValue: (values: DateValue[]) => void;
        setView: (view: DateView) => void;
        showWeekNumbers: boolean;
        value: DateValue[];
        valueAsDate: Date[];
        valueAsString: string[];
        view: DateView;
        visibleRange: VisibleRange;
        visibleRangeText: VisibleRangeText;
        weekDays: WeekDay[];
        weeks: DateValue[][];
    }

    Hierarchy (View Summary)

    Index

    Properties

    clearValue: (options?: { focus?: boolean }) => void

    Clears the selected date(s).

    disabled: boolean

    Whether the date picker is disabled

    focused: boolean

    Whether the input is focused

    focusedValue: DateValue

    The focused date.

    focusedValueAsDate: Date

    The focused date as a Date object.

    focusedValueAsString: string

    The focused date as a string.

    focusMonth: (month: number) => void

    Function to set the selected month.

    focusYear: (year: number) => void

    Function to set the selected year.

    format: (value: DateValue, opts?: DateTimeFormatOptions) => string

    Formats the given date value based on the provided options.

    getClearTriggerProps: () => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getContentProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getControlProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getDaysInWeek: (week: number, from?: DateValue) => DateValue[]

    Returns an array of days in the week index counted from the provided start date, or the first visible date if not given.

    getDayTableCellProps: (
        props: DayTableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getDayTableCellState: (props: DayTableCellProps) => DayTableCellState

    Returns the state details for a given cell.

    getDayTableCellTriggerProps: (
        props: DayTableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getDecade: () => Range<number | undefined>

    Returns the start and end years of the decade.

    getInputProps: (
        props?: InputProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            InputHTMLAttributes<HTMLInputElement>,
            HTMLInputElement,
        >,
    >
    getLabelProps: (
        props?: LabelProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            LabelHTMLAttributes<HTMLLabelElement>,
            HTMLLabelElement,
        >,
    >
    getMonths: (props?: MonthFormatOptions) => Cell[]

    Returns the months of the year

    getMonthSelectProps: () => WithoutRef<
        DetailedHTMLProps<
            SelectHTMLAttributes<HTMLSelectElement>,
            HTMLSelectElement,
        >,
    >
    getMonthsGrid: (props?: MonthGridProps) => MonthGridValue

    Returns the months of the year based on the columns. Represented as an array of arrays of months.

    getMonthTableCellProps: (
        props: TableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getMonthTableCellState: (props: TableCellProps) => TableCellState

    Returns the state details for a given month cell.

    getMonthTableCellTriggerProps: (
        props: TableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getMonthWeeks: (from?: DateValue) => DateValue[][]

    Returns the weeks of the month from the provided date. Represented as an array of arrays of dates.

    getNextTriggerProps: (
        props?: ViewProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getOffset: (duration: DateDuration) => DateValueOffset

    Returns the offset of the month based on the provided number of months.

    getPositionerProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getPresetTriggerProps: (
        props: PresetTriggerProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getPrevTriggerProps: (
        props?: ViewProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getRangePresetValue: (value: DatePicker.DateRangePreset) => DateValue[]

    Returns the range of dates based on the provided date range preset.

    getRangeTextProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getRootProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getTableBodyProps: (
        props?: TableProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getTableHeaderProps: (
        props?: TableProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getTableHeadProps: (
        props?: TableProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getTableProps: (props?: TableProps) => WithoutRef<HTMLAttributes<HTMLElement>>
    getTableRowProps: (
        props?: TableProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getTriggerProps: () => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getViewControlProps: (
        props?: ViewProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getViewProps: (props?: ViewProps) => WithoutRef<HTMLAttributes<HTMLElement>>
    getViewTriggerProps: (
        props?: ViewProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getWeekNumber: (week: DateValue[]) => number

    Returns the ISO 8601 week number (1-53) for the given week (array of dates).

    getWeekNumberCellProps: (
        props: WeekNumberCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getWeekNumberHeaderCellProps: (
        props?: TableProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getYears: () => Cell[]

    Returns the months of the year

    getYearSelectProps: () => WithoutRef<
        DetailedHTMLProps<
            SelectHTMLAttributes<HTMLSelectElement>,
            HTMLSelectElement,
        >,
    >
    getYearsGrid: (props?: YearGridProps) => YearGridValue

    Returns the years of the decade based on the columns. Represented as an array of arrays of years.

    getYearTableCellProps: (
        props: TableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getYearTableCellState: (props: TableCellProps) => TableCellState

    Returns the state details for a given year cell.

    getYearTableCellTriggerProps: (
        props: TableCellProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    goToNext: VoidFunction

    Goes to the next month/year/decade.

    goToPrev: VoidFunction

    Goes to the previous month/year/decade.

    inline: boolean

    Whether the date picker is rendered inline

    invalid: boolean

    Whether the date picker is invalid

    isMaxSelected: boolean

    Whether the maximum number of selected dates has been reached.

    isUnavailable: (date: DateValue) => boolean

    Returns whether the provided date is available (or can be selected)

    maxSelectedDates: number | undefined

    The maximum number of dates that can be selected (only for multiple selection mode).

    numOfMonths: number

    The number of months to display

    open: boolean

    Whether the date picker is open

    readOnly: boolean

    Whether the date picker is read-only

    selectionMode: SelectionMode

    The selection mode (single, multiple, or range)

    selectToday: VoidFunction

    Sets the selected date to today.

    setFocusedValue: (value: DateValue) => void

    Sets the focused date to the given date.

    setOpen: (open: boolean) => void

    Function to open or close the calendar.

    setTime: (time: Time, index?: number) => void

    Sets the time for a specific date value. Converts CalendarDate to CalendarDateTime if needed.

    setValue: (values: DateValue[]) => void

    Sets the selected date to the given date.

    setView: (view: DateView) => void

    Sets the view of the date picker.

    showWeekNumbers: boolean

    Whether the week number column is shown in the day view

    value: DateValue[]

    The selected date.

    valueAsDate: Date[]

    The selected date as a Date object.

    valueAsString: string[]

    The selected date as a string.

    view: DateView

    The current view of the date picker

    visibleRange: VisibleRange

    The visible range of dates.

    visibleRangeText: VisibleRangeText

    The human readable text for the visible range of dates.

    weekDays: WeekDay[]

    The days of the week. Represented as an array of strings.

    weeks: DateValue[][]

    The weeks of the month. Represented as an array of arrays of dates.