@atlaskit/calendar
Version:
An interactive calendar for date selection experiences.
16 lines (15 loc) • 789 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;
};