const customDateFormatter = new Intl.DateTimeFormat('en', {
day: 'numeric',
month: 'long',
year: 'numeric',
});
const {
portalRef,
inputRef,
selectedDate,
selectorShown,
setSelectorShown,
currentMonth,
setCurrentMonth,
dropdownPosition,
isSameDate,
tomorrow,
offset,
year,
month,
totalDays,
dayLabels,
totalCells,
handleSelectDate,
} = useDatePicker({ name, setValue, trigger, customDateFormatter });
Hook that provides functionality for building a custom date picker with theme-able styles.
Exposes refs used for popup pickers positioned with
createPortal.Takes optional props to integrate with
react-hook-form.Takes optional
Intl.DateTimeFormatformatter to allow custom formatting of dates.