Rocky_Mountain_Vending/.pnpm-store/v10/files/09/acf4f033c4c9ee89e70eea5fee1e9eac6eec66224a46d9277bbddd29c041b87f7981c3f84e7b6c8e2c0c67dbc2a7c7d32a6088b74888ef388c5e010168cab6
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

35 lines
No EOL
1.5 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMonthOptions = getMonthOptions;
/**
* Returns the months to show in the dropdown.
*
* This function generates a list of months for the current year, formatted
* using the provided formatter, and determines whether each month should be
* disabled based on the navigation range.
*
* @param displayMonth The currently displayed month.
* @param navStart The start date for navigation.
* @param navEnd The end date for navigation.
* @param formatters The formatters to use for formatting the month labels.
* @param dateLib The date library to use for date manipulation.
* @returns An array of dropdown options representing the months, or `undefined`
* if no months are available.
*/
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth } = dateLib;
const months = eachMonthOfInterval({
start: startOfYear(displayMonth),
end: endOfYear(displayMonth)
});
const options = months.map((month) => {
const label = formatters.formatMonthDropdown(month, dateLib);
const value = getMonth(month);
const disabled = (navStart && month < startOfMonth(navStart)) ||
(navEnd && month > startOfMonth(navEnd)) ||
false;
return { value, label, disabled };
});
return options;
}
//# sourceMappingURL=getMonthOptions.js.map