"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const index_util_1 = require("./index.util");
const useBaseDatePicker = ({ displayDate, onUpdateDisplayDate, }) => {
    const displayYear = displayDate.year;
    const displayMonth = displayDate.month;
    const dateList = (0, react_1.useMemo)(() => (0, index_util_1.getDateListByWeek)({
        displayYear,
        displayMonth,
    }), [displayYear, displayMonth]);
    const handleClickPrevMonth = () => {
        onUpdateDisplayDate(displayDate.addMonth(-1));
    };
    const handleClickNextMonth = () => {
        onUpdateDisplayDate(displayDate.addMonth(1));
    };
    const handleClickPrevYear = () => {
        onUpdateDisplayDate(displayDate.addYear(-1));
    };
    const handleClickNextYear = () => {
        onUpdateDisplayDate(displayDate.addYear(1));
    };
    return {
        dateList,
        displayYear,
        displayMonth,
        handleClickPrevMonth,
        handleClickNextMonth,
        handleClickPrevYear,
        handleClickNextYear,
    };
};
exports.default = useBaseDatePicker;
