registration
This commit is contained in:
25
frontend/style/node_modules/date-fns/endOfISOWeekYear.js
generated
vendored
25
frontend/style/node_modules/date-fns/endOfISOWeekYear.js
generated
vendored
@@ -1,8 +1,10 @@
|
||||
"use strict";
|
||||
exports.endOfISOWeekYear = endOfISOWeekYear;
|
||||
var _index = require("./getISOWeekYear.js");
|
||||
var _index2 = require("./startOfISOWeek.js");
|
||||
var _index3 = require("./constructFrom.js");
|
||||
import { constructFrom } from "./constructFrom.js";
|
||||
import { getISOWeekYear } from "./getISOWeekYear.js";
|
||||
import { startOfISOWeek } from "./startOfISOWeek.js";
|
||||
|
||||
/**
|
||||
* The {@link endOfISOWeekYear} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name endOfISOWeekYear
|
||||
@@ -17,8 +19,10 @@ var _index3 = require("./constructFrom.js");
|
||||
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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).
|
||||
* @typeParam ContextDate - The `Date` type of the context function.
|
||||
*
|
||||
* @param date - The original date
|
||||
* @param options - The options
|
||||
*
|
||||
* @returns The end of an ISO week-numbering year
|
||||
*
|
||||
@@ -27,12 +31,15 @@ var _index3 = require("./constructFrom.js");
|
||||
* const result = endOfISOWeekYear(new Date(2005, 6, 2))
|
||||
* //=> Sun Jan 01 2006 23:59:59.999
|
||||
*/
|
||||
function endOfISOWeekYear(date) {
|
||||
const year = (0, _index.getISOWeekYear)(date);
|
||||
const fourthOfJanuaryOfNextYear = (0, _index3.constructFrom)(date, 0);
|
||||
export function endOfISOWeekYear(date, options) {
|
||||
const year = getISOWeekYear(date, options);
|
||||
const fourthOfJanuaryOfNextYear = constructFrom(options?.in || date, 0);
|
||||
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
||||
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
||||
const _date = (0, _index2.startOfISOWeek)(fourthOfJanuaryOfNextYear);
|
||||
const _date = startOfISOWeek(fourthOfJanuaryOfNextYear, options);
|
||||
_date.setMilliseconds(_date.getMilliseconds() - 1);
|
||||
return _date;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default endOfISOWeekYear;
|
||||
|
||||
Reference in New Issue
Block a user