@atlaskit/calendar
Version:
An interactive calendar for date selection experiences.
28 lines (27 loc) • 877 B
TypeScript
import type { ChangeEvent } from '../../types';
import type { ArrowKeys } from '../types';
export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [_shouldSetFocus, setShouldSetFocus], onChange, }: {
day: readonly [
number,
(newValue: number) => void
];
month: readonly [
number,
(newValue: number) => void
];
year: readonly [
number,
(newValue: number) => void
];
shouldSetFocus: readonly [
boolean,
(newValue: boolean) => void
];
onChange: (event: ChangeEvent) => void;
}): {
navigate: (type: ArrowKeys) => void;
handleClickNextMonth: () => void;
handleClickNextYear: () => void;
handleClickPrevMonth: () => void;
handleClickPrevYear: () => void;
};