Rocky_Mountain_Vending/.pnpm-store/v10/files/ee/7a8d95ce4c1212e4f05b9bc7d115f34e1aa6388cc40a61e4da2cc2da7ce5717cf14b9f7d157414a3b9bc379b0f80c96363a8c98cbbf2f2f0ced9276d03b441
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

38 lines
No EOL
1.5 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNextMonth = getNextMonth;
/**
* Returns the next month the user can navigate to, based on the given options.
*
* The next month is not always the next calendar month:
*
* - If it is after the `calendarEndMonth`, it returns `undefined`.
* - If paged navigation is enabled, it skips forward by the number of displayed
* months.
*
* @param firstDisplayedMonth The first month currently displayed in the
* calendar.
* @param calendarEndMonth The latest month the user can navigate to.
* @param options Navigation options, including `numberOfMonths` and
* `pagedNavigation`.
* @param dateLib The date library to use for date manipulation.
* @returns The next month, or `undefined` if navigation is not possible.
*/
function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
if (options.disableNavigation) {
return undefined;
}
const { pagedNavigation, numberOfMonths = 1 } = options;
const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
const offset = pagedNavigation ? numberOfMonths : 1;
const month = startOfMonth(firstDisplayedMonth);
if (!calendarEndMonth) {
return addMonths(month, offset);
}
const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);
if (monthsDiff < numberOfMonths) {
return undefined;
}
return addMonths(month, offset);
}
//# sourceMappingURL=getNextMonth.js.map