registration
This commit is contained in:
31
frontend/style/node_modules/date-fns/isSameMonth.js
generated
vendored
31
frontend/style/node_modules/date-fns/isSameMonth.js
generated
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user