import { isExact, isFrom } from '../utils';
/**
 * Calculate the selected dates
 * If we are in single calendar mode, will use the startDate as selected date
 * Memoized so will only recalculate when selectedDates or mode changes
 */
export const useSelectedDate = ({ selectedDates, mode }) => {
    const currentDateTime = isFrom(mode) || isExact(mode) ? selectedDates?.startDate : selectedDates?.endDate;
    const minSelectedDateTime = selectedDates?.startDate || undefined;
    const maxSelectedDateTime = selectedDates?.endDate || undefined;
    return {
        currentDateTime,
        maxSelectedDateTime,
        minSelectedDateTime,
    };
};
//# sourceMappingURL=useSelectedDate.js.map