registration
This commit is contained in:
24
frontend/style/node_modules/date-fns/isThisYear.js
generated
vendored
24
frontend/style/node_modules/date-fns/isThisYear.js
generated
vendored
@@ -1,7 +1,10 @@
|
||||
"use strict";
|
||||
exports.isThisYear = isThisYear;
|
||||
var _index = require("./constructNow.js");
|
||||
var _index2 = require("./isSameYear.js");
|
||||
import { constructFrom } from "./constructFrom.js";
|
||||
import { constructNow } from "./constructNow.js";
|
||||
import { isSameYear } from "./isSameYear.js";
|
||||
|
||||
/**
|
||||
* The {@link isThisYear} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name isThisYear
|
||||
@@ -12,9 +15,8 @@ var _index2 = require("./isSameYear.js");
|
||||
* @description
|
||||
* Is the given date in the same year 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 year
|
||||
*
|
||||
@@ -23,6 +25,12 @@ var _index2 = require("./isSameYear.js");
|
||||
* const result = isThisYear(new Date(2014, 6, 2))
|
||||
* //=> true
|
||||
*/
|
||||
function isThisYear(date) {
|
||||
return (0, _index2.isSameYear)(date, (0, _index.constructNow)(date));
|
||||
export function isThisYear(date, options) {
|
||||
return isSameYear(
|
||||
constructFrom(options?.in || date, date),
|
||||
constructNow(options?.in || date),
|
||||
);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default isThisYear;
|
||||
|
||||
Reference in New Issue
Block a user