//#region src/calendar/hooks/useDefaultViewMonth.ts
/**
* Calculates the default view date, either using selected date, current date or boundaries
* Used when initializing, after that viewDate will be set
* Memoized so will only recalculate when boundaries or selectedDate changes
*/
const useDefaultViewMonth = ({ boundaries, selectedDate, isStartDate }) => {
	if (selectedDate) return selectedDate;
	const currentDate = /* @__PURE__ */ new Date();
	if (!boundaries) return currentDate;
	if (boundaries.endDate && currentDate > boundaries.endDate && !isStartDate) return boundaries.endDate;
	if (boundaries.startDate && currentDate > boundaries.startDate && isStartDate) return boundaries.startDate;
	return currentDate;
};

//#endregion
export { useDefaultViewMonth };
globalThis.__vuiVersion__ = "4.0.0"
//# sourceMappingURL=useDefaultViewMonth.js.map