Rocky_Mountain_Vending/.pnpm-store/v10/files/c3/0645e873a6e8adb0f6b77395baa77bea67b9bf1ff1344929e5684e861226b4d437e1de77df94097b150c6c7b9492360e7593b090c0540afbd9efbc078929b0
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

34 lines
777 B
Text

import { toDate } from "./toDate.js";
import { getMonth as coreGetMonth } from "./_core/getMonth.js";
/**
* The {@link getQuarter} function options.
*/
/**
* @name getQuarter
* @category Quarter Helpers
* @summary Get the year quarter of the given date.
*
* @description
* Get the year quarter of the given date.
*
* @param date - The given date
* @param options - An object with options
*
* @returns The quarter
*
* @example
* // Which quarter is 2 July 2014?
* const result = getQuarter(new Date(2014, 6, 2));
* //=> 3
*/
export function getQuarter(date, options) {
const _date = toDate(date, options?.in);
const quarter = Math.trunc(coreGetMonth(_date) / 3) + 1;
return quarter;
}
// Fallback for modularized imports:
export default getQuarter;