registration
This commit is contained in:
31
frontend/style/node_modules/date-fns/isSameQuarter.js
generated
vendored
31
frontend/style/node_modules/date-fns/isSameQuarter.js
generated
vendored
@@ -1,6 +1,9 @@
|
||||
"use strict";
|
||||
exports.isSameQuarter = isSameQuarter;
|
||||
var _index = require("./startOfQuarter.js");
|
||||
import { normalizeDates } from "./_lib/normalizeDates.js";
|
||||
import { startOfQuarter } from "./startOfQuarter.js";
|
||||
|
||||
/**
|
||||
* The {@link isSameQuarter} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name isSameQuarter
|
||||
@@ -10,11 +13,10 @@ var _index = require("./startOfQuarter.js");
|
||||
* @description
|
||||
* Are the given dates in the same quarter (and year)?
|
||||
*
|
||||
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
||||
* @param laterDate - The first date to check
|
||||
* @param earlierDate - The second date to check
|
||||
* @param options - An object with options
|
||||
*
|
||||
* @param dateLeft - The first date to check
|
||||
* @param dateRight - The second date to check
|
||||
|
||||
* @returns The dates are in the same quarter (and year)
|
||||
*
|
||||
* @example
|
||||
@@ -27,9 +29,14 @@ var _index = require("./startOfQuarter.js");
|
||||
* const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1))
|
||||
* //=> false
|
||||
*/
|
||||
function isSameQuarter(dateLeft, dateRight) {
|
||||
const dateLeftStartOfQuarter = (0, _index.startOfQuarter)(dateLeft);
|
||||
const dateRightStartOfQuarter = (0, _index.startOfQuarter)(dateRight);
|
||||
|
||||
return +dateLeftStartOfQuarter === +dateRightStartOfQuarter;
|
||||
export function isSameQuarter(laterDate, earlierDate, options) {
|
||||
const [dateLeft_, dateRight_] = normalizeDates(
|
||||
options?.in,
|
||||
laterDate,
|
||||
earlierDate,
|
||||
);
|
||||
return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default isSameQuarter;
|
||||
|
||||
Reference in New Issue
Block a user