Rocky_Mountain_Vending/.pnpm-store/v10/files/86/45a9c5e05ad8bfb535ec0e1ba846acb46b52139c3b6dc7ece8c25e09b13a09d0a0aad842bf34bef6b3d9111a9901cd5f22f7b3a4f8fa14cda018aaaf18aa57
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

53 lines
No EOL
1.8 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNavMonths = getNavMonths;
/**
* Returns the start and end months for calendar navigation.
*
* @param props The DayPicker props, including navigation and layout options.
* @param dateLib The date library to use for date manipulation.
* @returns A tuple containing the start and end months for navigation.
*/
function getNavMonths(props, dateLib) {
let { startMonth, endMonth } = props;
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today } = dateLib;
// Handle deprecated code
const { fromYear, toYear, fromMonth, toMonth } = props;
if (!startMonth && fromMonth) {
startMonth = fromMonth;
}
if (!startMonth && fromYear) {
startMonth = dateLib.newDate(fromYear, 0, 1);
}
if (!endMonth && toMonth) {
endMonth = toMonth;
}
if (!endMonth && toYear) {
endMonth = newDate(toYear, 11, 31);
}
const hasYearDropdown = props.captionLayout === "dropdown" ||
props.captionLayout === "dropdown-years";
if (startMonth) {
startMonth = startOfMonth(startMonth);
}
else if (fromYear) {
startMonth = newDate(fromYear, 0, 1);
}
else if (!startMonth && hasYearDropdown) {
startMonth = startOfYear(addYears(props.today ?? today(), -100));
}
if (endMonth) {
endMonth = endOfMonth(endMonth);
}
else if (toYear) {
endMonth = newDate(toYear, 11, 31);
}
else if (!endMonth && hasYearDropdown) {
endMonth = endOfYear(props.today ?? today());
}
return [
startMonth ? startOfDay(startMonth) : startMonth,
endMonth ? startOfDay(endMonth) : endMonth
];
}
//# sourceMappingURL=getNavMonth.js.map