Rocky_Mountain_Vending/.pnpm-store/v10/files/69/76abacd7282644a210f347cbc9b571bf8831556a0263879211e607124b716ab23f2f3fe322a27a2d4cf57357680c3a30beaa2e7068ec47a525f6ee7096005e
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

48 lines
1.3 KiB
Text

import { normalizeDates } from "./_lib/normalizeDates.js";
import { getISOWeekYear } from "./getISOWeekYear.js";
/**
* The {@link differenceInCalendarISOWeekYears} function options.
*/
/**
* @name differenceInCalendarISOWeekYears
* @category ISO Week-Numbering Year Helpers
* @summary Get the number of calendar ISO week-numbering years between the given dates.
*
* @description
* Get the number of calendar ISO week-numbering years between the given dates.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
*
* @returns The number of calendar ISO week-numbering years
*
* @example
* // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?
* const result = differenceInCalendarISOWeekYears(
* new Date(2012, 0, 1),
* new Date(2010, 0, 1)
* )
* //=> 2
*/
export function differenceInCalendarISOWeekYears(
laterDate,
earlierDate,
options,
) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return (
getISOWeekYear(laterDate_, options) - getISOWeekYear(earlierDate_, options)
);
}
// Fallback for modularized imports:
export default differenceInCalendarISOWeekYears;