Rocky_Mountain_Vending/.pnpm-store/v10/files/58/f52b0c9293e6a346e413b5e118d4ee240d5bb5f10c5f854322703e9b36caddd1f449e99368f81ed69f20f2788d4fa5a3efb4a12a75b8f071d0141c8103b39a
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

44 lines
1.2 KiB
Text

"use strict";
exports.isSameQuarter = isSameQuarter;
var _index = require("./_lib/normalizeDates.cjs");
var _index2 = require("./startOfQuarter.cjs");
/**
* The {@link isSameQuarter} function options.
*/
/**
* @name isSameQuarter
* @category Quarter Helpers
* @summary Are the given dates in the same quarter (and year)?
*
* @description
* Are the given dates in the same quarter (and year)?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same quarter (and year)
*
* @example
* // Are 1 January 2014 and 8 March 2014 in the same quarter?
* const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))
* //=> true
*
* @example
* // Are 1 January 2014 and 1 January 2015 in the same quarter?
* const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1))
* //=> false
*/
function isSameQuarter(laterDate, earlierDate, options) {
const [dateLeft_, dateRight_] = (0, _index.normalizeDates)(
options?.in,
laterDate,
earlierDate,
);
return (
+(0, _index2.startOfQuarter)(dateLeft_) ===
+(0, _index2.startOfQuarter)(dateRight_)
);
}