Files
klz-cables.com/.pnpm-store/v10/files/2e/f6e5638e31c114682c941df2bdd79e8754d0726edbbb5dfa0ef31a6d32334b6df3c71536ddcf0f78945afc4a73eb321a26bc2201966ff1d16755b95f9ccf73
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

32 lines
696 B
Plaintext

"use strict";
exports.getQuarter = getQuarter;
var _index = require("./toDate.cjs");
/**
* 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
*/
function getQuarter(date, options) {
const _date = (0, _index.toDate)(date, options?.in);
const quarter = Math.trunc(_date.getMonth() / 3) + 1;
return quarter;
}