registration

This commit is contained in:
User
2025-02-02 16:08:03 +03:00
parent 7f6495eb4d
commit 78afbaed71
6334 changed files with 196774 additions and 165754 deletions

View File

@@ -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;