Rocky_Mountain_Vending/.pnpm-store/v10/files/d2/ec3da94d2a83e6f7020b5cc2ddaa13fdafba50c4cef2a7e1fe88526cedc81007be491aaaa6263020791e4c9d81c01fff30dcd6f433d1a516d92b4f5dd1a4e4
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

30 lines
No EOL
1.3 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBroadcastWeeksInMonth = getBroadcastWeeksInMonth;
const FIVE_WEEKS = 5;
const FOUR_WEEKS = 4;
/**
* Returns the number of weeks to display in the broadcast calendar for a given
* month.
*
* The broadcast calendar may have either 4 or 5 weeks in a month, depending on
* the start and end dates of the broadcast weeks.
*
* @since 9.4.0
* @param month The month for which to calculate the number of weeks.
* @param dateLib The date library to use for date manipulation.
* @returns The number of weeks in the broadcast calendar (4 or 5).
*/
function getBroadcastWeeksInMonth(month, dateLib) {
// Get the first day of the month
const firstDayOfMonth = dateLib.startOfMonth(month);
// Get the day of the week for the first day of the month (1-7, where 1 is Monday)
const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek)
? FIVE_WEEKS
: FOUR_WEEKS;
return numberOfWeeks;
}
//# sourceMappingURL=getBroadcastWeeksInMonth.js.map