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.isThisMonth = isThisMonth;
var _index = require("./constructNow.js");
var _index2 = require("./isSameMonth.js");
import { constructFrom } from "./constructFrom.js";
import { constructNow } from "./constructNow.js";
import { isSameMonth } from "./isSameMonth.js";
/**
* The {@link isThisMonth} function options.
*/
/**
* @name isThisMonth
@@ -12,9 +15,8 @@ var _index2 = require("./isSameMonth.js");
* @description
* Is the given date in the same month 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 month
*
@@ -23,7 +25,12 @@ var _index2 = require("./isSameMonth.js");
* const result = isThisMonth(new Date(2014, 8, 15))
* //=> true
*/
function isThisMonth(date) {
return (0, _index2.isSameMonth)(date, (0, _index.constructNow)(date));
export function isThisMonth(date, options) {
return isSameMonth(
constructFrom(options?.in || date, date),
constructNow(options?.in || date),
);
}
// Fallback for modularized imports:
export default isThisMonth;