Rocky_Mountain_Vending/.pnpm-store/v10/files/a5/c835e4cc7389f465720e48c2a1277ac7e4d7fc47e56fdb2172f69094ce86fe1dbcd0f574f5eda66f69849402bcd142a26eccc61c81e467aeebec55d26563a1
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

29 lines
No EOL
1.2 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInitialMonth = getInitialMonth;
/**
* Determines the initial month to display in the calendar based on the provided
* props.
*
* This function calculates the starting month, considering constraints such as
* `startMonth`, `endMonth`, and the number of months to display.
*
* @param props The DayPicker props, including navigation and date constraints.
* @param dateLib The date library to use for date manipulation.
* @returns The initial month to display.
*/
function getInitialMonth(props, navStart, navEnd, dateLib) {
const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1 } = props;
let initialMonth = month || defaultMonth || today;
const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;
if (navEnd &&
differenceInCalendarMonths(navEnd, initialMonth) < numberOfMonths - 1) {
const offset = -1 * (numberOfMonths - 1);
initialMonth = addMonths(navEnd, offset);
}
if (navStart && differenceInCalendarMonths(initialMonth, navStart) < 0) {
initialMonth = navStart;
}
return startOfMonth(initialMonth);
}
//# sourceMappingURL=getInitialMonth.js.map