Rocky_Mountain_Vending/.pnpm-store/v10/files/c7/30b14343781d6cf5069d650a7eaad6f0988c527cdd97a2a4f4824560ed04be2d73417e24222d0bd7cedba9f8fb67e968accc55a2496920e6fdc597d496963c
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

32 lines
709 B
Text

import { toDate } from "./toDate.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(_date.getMonth() / 3) + 1;
return quarter;
}
// Fallback for modularized imports:
export default getQuarter;