registration
This commit is contained in:
18
frontend/style/node_modules/date-fns/getYear.js
generated
vendored
18
frontend/style/node_modules/date-fns/getYear.js
generated
vendored
@@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
exports.getYear = getYear;
|
||||
var _index = require("./toDate.js");
|
||||
import { toDate } from "./toDate.js";
|
||||
|
||||
/**
|
||||
* The {@link getYear} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name getYear
|
||||
@@ -10,9 +12,8 @@ var _index = require("./toDate.js");
|
||||
* @description
|
||||
* Get the year of the given 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 given date
|
||||
* @param options - An object with options
|
||||
*
|
||||
* @returns The year
|
||||
*
|
||||
@@ -21,6 +22,9 @@ var _index = require("./toDate.js");
|
||||
* const result = getYear(new Date(2014, 6, 2))
|
||||
* //=> 2014
|
||||
*/
|
||||
function getYear(date) {
|
||||
return (0, _index.toDate)(date).getFullYear();
|
||||
export function getYear(date, options) {
|
||||
return toDate(date, options?.in).getFullYear();
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default getYear;
|
||||
|
||||
Reference in New Issue
Block a user