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,8 @@
"use strict";
exports.isSameMonth = isSameMonth;
var _index = require("./toDate.js");
import { normalizeDates } from "./_lib/normalizeDates.js";
/**
* The {@link isSameMonth} function options.
*/
/**
* @name isSameMonth
@@ -10,10 +12,9 @@ var _index = require("./toDate.js");
* @description
* Are the given dates in the same month (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 dateLeft - The first date to check
* @param dateRight - The second date to check
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same month (and year)
*
@@ -27,11 +28,17 @@ var _index = require("./toDate.js");
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
* //=> false
*/
function isSameMonth(dateLeft, dateRight) {
const _dateLeft = (0, _index.toDate)(dateLeft);
const _dateRight = (0, _index.toDate)(dateRight);
export function isSameMonth(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return (
_dateLeft.getFullYear() === _dateRight.getFullYear() &&
_dateLeft.getMonth() === _dateRight.getMonth()
laterDate_.getFullYear() === earlierDate_.getFullYear() &&
laterDate_.getMonth() === earlierDate_.getMonth()
);
}
// Fallback for modularized imports:
export default isSameMonth;