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,7 +1,10 @@
"use strict";
exports.isThisQuarter = isThisQuarter;
var _index = require("./constructNow.js");
var _index2 = require("./isSameQuarter.js");
import { constructFrom } from "./constructFrom.js";
import { constructNow } from "./constructNow.js";
import { isSameQuarter } from "./isSameQuarter.js";
/**
* The {@link isThisQuarter} function options.
*/
/**
* @name isThisQuarter
@@ -12,9 +15,8 @@ var _index2 = require("./isSameQuarter.js");
* @description
* Is the given date in the same quarter as the current date?
*
* @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 date - The date to check
* @param options - An object with options
*
* @returns The date is in this quarter
*
@@ -23,6 +25,12 @@ var _index2 = require("./isSameQuarter.js");
* const result = isThisQuarter(new Date(2014, 6, 2))
* //=> true
*/
function isThisQuarter(date) {
return (0, _index2.isSameQuarter)(date, (0, _index.constructNow)(date));
export function isThisQuarter(date, options) {
return isSameQuarter(
constructFrom(options?.in || date, date),
constructNow(options?.in || date),
);
}
// Fallback for modularized imports:
export default isThisQuarter;