import { isExact, isFrom } from "../utils.js";

//#region src/calendar/hooks/useSelectedDate.ts
/**
* 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
*/
const useSelectedDate = ({ selectedDates, mode }) => {
	const currentDateTime = isFrom(mode) || isExact(mode) ? selectedDates?.startDate : selectedDates?.endDate;
	const minSelectedDateTime = selectedDates?.startDate || void 0;
	return {
		currentDateTime,
		maxSelectedDateTime: selectedDates?.endDate || void 0,
		minSelectedDateTime
	};
};

//#endregion
export { useSelectedDate };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=useSelectedDate.js.map