Rocky_Mountain_Vending/.pnpm-store/v10/files/9b/e4f8c6ce82539f77ed93504de5be19393da4a18ee6e40ae67774738933e03abb71883e7efbe28e89153d106b212c45c9356a8501903a475df4ec5759df566a
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

39 lines
1 KiB
Text

import { normalizeDates } from "./_lib/normalizeDates.js";
/**
* The {@link differenceInCalendarYears} function options.
*/
/**
* @name differenceInCalendarYears
* @category Year Helpers
* @summary Get the number of calendar years between the given dates.
*
* @description
* Get the number of calendar years between the given dates.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
* @returns The number of calendar years
*
* @example
* // How many calendar years are between 31 December 2013 and 11 February 2015?
* const result = differenceInCalendarYears(
* new Date(2015, 1, 11),
* new Date(2013, 11, 31)
* );
* //=> 2
*/
export function differenceInCalendarYears(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return laterDate_.getFullYear() - earlierDate_.getFullYear();
}
// Fallback for modularized imports:
export default differenceInCalendarYears;