registration
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export function addLeadingZeros(number, targetLength) {
|
||||
"use strict";
|
||||
exports.addLeadingZeros = addLeadingZeros;
|
||||
function addLeadingZeros(number, targetLength) {
|
||||
const sign = number < 0 ? "-" : "";
|
||||
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
||||
return sign + output;
|
||||
4
frontend/style/node_modules/date-fns/_lib/addLeadingZeros.js
generated
vendored
4
frontend/style/node_modules/date-fns/_lib/addLeadingZeros.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.addLeadingZeros = addLeadingZeros;
|
||||
function addLeadingZeros(number, targetLength) {
|
||||
export function addLeadingZeros(number, targetLength) {
|
||||
const sign = number < 0 ? "-" : "";
|
||||
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
||||
return sign + output;
|
||||
|
||||
8
frontend/style/node_modules/date-fns/_lib/defaultLocale.cjs
generated
vendored
Normal file
8
frontend/style/node_modules/date-fns/_lib/defaultLocale.cjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "defaultLocale", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index.enUS;
|
||||
},
|
||||
});
|
||||
var _index = require("../locale/en-US.cjs");
|
||||
9
frontend/style/node_modules/date-fns/_lib/defaultLocale.js
generated
vendored
9
frontend/style/node_modules/date-fns/_lib/defaultLocale.js
generated
vendored
@@ -1,8 +1 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "defaultLocale", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index.enUS;
|
||||
},
|
||||
});
|
||||
var _index = require("../locale/en-US.js");
|
||||
export { enUS as defaultLocale } from "../locale/en-US.js";
|
||||
|
||||
1
frontend/style/node_modules/date-fns/_lib/defaultLocale.mjs
generated
vendored
1
frontend/style/node_modules/date-fns/_lib/defaultLocale.mjs
generated
vendored
@@ -1 +0,0 @@
|
||||
export { enUS as defaultLocale } from "../locale/en-US.mjs";
|
||||
13
frontend/style/node_modules/date-fns/_lib/defaultOptions.cjs
generated
vendored
Normal file
13
frontend/style/node_modules/date-fns/_lib/defaultOptions.cjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
exports.getDefaultOptions = getDefaultOptions;
|
||||
exports.setDefaultOptions = setDefaultOptions;
|
||||
|
||||
let defaultOptions = {};
|
||||
|
||||
function getDefaultOptions() {
|
||||
return defaultOptions;
|
||||
}
|
||||
|
||||
function setDefaultOptions(newOptions) {
|
||||
defaultOptions = newOptions;
|
||||
}
|
||||
8
frontend/style/node_modules/date-fns/_lib/defaultOptions.js
generated
vendored
8
frontend/style/node_modules/date-fns/_lib/defaultOptions.js
generated
vendored
@@ -1,13 +1,9 @@
|
||||
"use strict";
|
||||
exports.getDefaultOptions = getDefaultOptions;
|
||||
exports.setDefaultOptions = setDefaultOptions;
|
||||
|
||||
let defaultOptions = {};
|
||||
|
||||
function getDefaultOptions() {
|
||||
export function getDefaultOptions() {
|
||||
return defaultOptions;
|
||||
}
|
||||
|
||||
function setDefaultOptions(newOptions) {
|
||||
export function setDefaultOptions(newOptions) {
|
||||
defaultOptions = newOptions;
|
||||
}
|
||||
|
||||
9
frontend/style/node_modules/date-fns/_lib/defaultOptions.mjs
generated
vendored
9
frontend/style/node_modules/date-fns/_lib/defaultOptions.mjs
generated
vendored
@@ -1,9 +0,0 @@
|
||||
let defaultOptions = {};
|
||||
|
||||
export function getDefaultOptions() {
|
||||
return defaultOptions;
|
||||
}
|
||||
|
||||
export function setDefaultOptions(newOptions) {
|
||||
defaultOptions = newOptions;
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
import { getDayOfYear } from "../../getDayOfYear.mjs";
|
||||
import { getISOWeek } from "../../getISOWeek.mjs";
|
||||
import { getISOWeekYear } from "../../getISOWeekYear.mjs";
|
||||
import { getWeek } from "../../getWeek.mjs";
|
||||
import { getWeekYear } from "../../getWeekYear.mjs";
|
||||
import { addLeadingZeros } from "../addLeadingZeros.mjs";
|
||||
import { lightFormatters } from "./lightFormatters.mjs";
|
||||
"use strict";
|
||||
exports.formatters = void 0;
|
||||
var _index = require("../../getDayOfYear.cjs");
|
||||
var _index2 = require("../../getISOWeek.cjs");
|
||||
var _index3 = require("../../getISOWeekYear.cjs");
|
||||
var _index4 = require("../../getWeek.cjs");
|
||||
var _index5 = require("../../getWeekYear.cjs");
|
||||
|
||||
var _index6 = require("../addLeadingZeros.cjs");
|
||||
var _index7 = require("./lightFormatters.cjs");
|
||||
|
||||
const dayPeriodEnum = {
|
||||
am: "am",
|
||||
@@ -63,7 +66,7 @@ const dayPeriodEnum = {
|
||||
* - `p` is long localized time format
|
||||
*/
|
||||
|
||||
export const formatters = {
|
||||
const formatters = (exports.formatters = {
|
||||
// Era
|
||||
G: function (date, token, localize) {
|
||||
const era = date.getFullYear() > 0 ? 1 : 0;
|
||||
@@ -93,19 +96,19 @@ export const formatters = {
|
||||
return localize.ordinalNumber(year, { unit: "year" });
|
||||
}
|
||||
|
||||
return lightFormatters.y(date, token);
|
||||
return _index7.lightFormatters.y(date, token);
|
||||
},
|
||||
|
||||
// Local week-numbering year
|
||||
Y: function (date, token, localize, options) {
|
||||
const signedWeekYear = getWeekYear(date, options);
|
||||
const signedWeekYear = (0, _index5.getWeekYear)(date, options);
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
||||
|
||||
// Two digit year
|
||||
if (token === "YY") {
|
||||
const twoDigitYear = weekYear % 100;
|
||||
return addLeadingZeros(twoDigitYear, 2);
|
||||
return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
|
||||
}
|
||||
|
||||
// Ordinal number
|
||||
@@ -114,15 +117,15 @@ export const formatters = {
|
||||
}
|
||||
|
||||
// Padding
|
||||
return addLeadingZeros(weekYear, token.length);
|
||||
return (0, _index6.addLeadingZeros)(weekYear, token.length);
|
||||
},
|
||||
|
||||
// ISO week-numbering year
|
||||
R: function (date, token) {
|
||||
const isoWeekYear = getISOWeekYear(date);
|
||||
const isoWeekYear = (0, _index3.getISOWeekYear)(date);
|
||||
|
||||
// Padding
|
||||
return addLeadingZeros(isoWeekYear, token.length);
|
||||
return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
|
||||
},
|
||||
|
||||
// Extended year. This is a single number designating the year of this calendar system.
|
||||
@@ -136,7 +139,7 @@ export const formatters = {
|
||||
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
||||
u: function (date, token) {
|
||||
const year = date.getFullYear();
|
||||
return addLeadingZeros(year, token.length);
|
||||
return (0, _index6.addLeadingZeros)(year, token.length);
|
||||
},
|
||||
|
||||
// Quarter
|
||||
@@ -148,7 +151,7 @@ export const formatters = {
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "QQ":
|
||||
return addLeadingZeros(quarter, 2);
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "Qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
@@ -183,7 +186,7 @@ export const formatters = {
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "qq":
|
||||
return addLeadingZeros(quarter, 2);
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
@@ -215,7 +218,7 @@ export const formatters = {
|
||||
switch (token) {
|
||||
case "M":
|
||||
case "MM":
|
||||
return lightFormatters.M(date, token);
|
||||
return _index7.lightFormatters.M(date, token);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Mo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
@@ -247,7 +250,7 @@ export const formatters = {
|
||||
return String(month + 1);
|
||||
// 01, 02, ..., 12
|
||||
case "LL":
|
||||
return addLeadingZeros(month + 1, 2);
|
||||
return (0, _index6.addLeadingZeros)(month + 1, 2);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Lo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
@@ -272,24 +275,24 @@ export const formatters = {
|
||||
|
||||
// Local week of year
|
||||
w: function (date, token, localize, options) {
|
||||
const week = getWeek(date, options);
|
||||
const week = (0, _index4.getWeek)(date, options);
|
||||
|
||||
if (token === "wo") {
|
||||
return localize.ordinalNumber(week, { unit: "week" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(week, token.length);
|
||||
return (0, _index6.addLeadingZeros)(week, token.length);
|
||||
},
|
||||
|
||||
// ISO week of year
|
||||
I: function (date, token, localize) {
|
||||
const isoWeek = getISOWeek(date);
|
||||
const isoWeek = (0, _index2.getISOWeek)(date);
|
||||
|
||||
if (token === "Io") {
|
||||
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(isoWeek, token.length);
|
||||
return (0, _index6.addLeadingZeros)(isoWeek, token.length);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
@@ -298,18 +301,18 @@ export const formatters = {
|
||||
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
||||
}
|
||||
|
||||
return lightFormatters.d(date, token);
|
||||
return _index7.lightFormatters.d(date, token);
|
||||
},
|
||||
|
||||
// Day of year
|
||||
D: function (date, token, localize) {
|
||||
const dayOfYear = getDayOfYear(date);
|
||||
const dayOfYear = (0, _index.getDayOfYear)(date);
|
||||
|
||||
if (token === "Do") {
|
||||
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(dayOfYear, token.length);
|
||||
return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
|
||||
},
|
||||
|
||||
// Day of week
|
||||
@@ -356,7 +359,7 @@ export const formatters = {
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "ee":
|
||||
return addLeadingZeros(localDayOfWeek, 2);
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "eo":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
@@ -397,7 +400,7 @@ export const formatters = {
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "cc":
|
||||
return addLeadingZeros(localDayOfWeek, token.length);
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "co":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
@@ -438,7 +441,7 @@ export const formatters = {
|
||||
return String(isoDayOfWeek);
|
||||
// 02
|
||||
case "ii":
|
||||
return addLeadingZeros(isoDayOfWeek, token.length);
|
||||
return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
|
||||
// 2nd
|
||||
case "io":
|
||||
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
||||
@@ -587,7 +590,7 @@ export const formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return lightFormatters.h(date, token);
|
||||
return _index7.lightFormatters.h(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
@@ -596,7 +599,7 @@ export const formatters = {
|
||||
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
||||
}
|
||||
|
||||
return lightFormatters.H(date, token);
|
||||
return _index7.lightFormatters.H(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-11]
|
||||
@@ -607,7 +610,7 @@ export const formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(hours, token.length);
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
},
|
||||
|
||||
// Hour [1-24]
|
||||
@@ -619,7 +622,7 @@ export const formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(hours, token.length);
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
@@ -628,7 +631,7 @@ export const formatters = {
|
||||
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
||||
}
|
||||
|
||||
return lightFormatters.m(date, token);
|
||||
return _index7.lightFormatters.m(date, token);
|
||||
},
|
||||
|
||||
// Second
|
||||
@@ -637,12 +640,12 @@ export const formatters = {
|
||||
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
||||
}
|
||||
|
||||
return lightFormatters.s(date, token);
|
||||
return _index7.lightFormatters.s(date, token);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S: function (date, token) {
|
||||
return lightFormatters.S(date, token);
|
||||
return _index7.lightFormatters.S(date, token);
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
||||
@@ -737,16 +740,15 @@ export const formatters = {
|
||||
|
||||
// Seconds timestamp
|
||||
t: function (date, token, _localize) {
|
||||
const timestamp = Math.trunc(date.getTime() / 1000);
|
||||
return addLeadingZeros(timestamp, token.length);
|
||||
const timestamp = Math.trunc(+date / 1000);
|
||||
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
||||
},
|
||||
|
||||
// Milliseconds timestamp
|
||||
T: function (date, token, _localize) {
|
||||
const timestamp = date.getTime();
|
||||
return addLeadingZeros(timestamp, token.length);
|
||||
return (0, _index6.addLeadingZeros)(+date, token.length);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
function formatTimezoneShort(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
@@ -756,13 +758,15 @@ function formatTimezoneShort(offset, delimiter = "") {
|
||||
if (minutes === 0) {
|
||||
return sign + String(hours);
|
||||
}
|
||||
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
||||
return (
|
||||
sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
|
||||
);
|
||||
}
|
||||
|
||||
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
||||
if (offset % 60 === 0) {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
||||
return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
|
||||
}
|
||||
return formatTimezone(offset, delimiter);
|
||||
}
|
||||
@@ -770,7 +774,7 @@ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
||||
function formatTimezone(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
const absOffset = Math.abs(offset);
|
||||
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
||||
const minutes = addLeadingZeros(absOffset % 60, 2);
|
||||
const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
|
||||
const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
|
||||
return sign + hours + delimiter + minutes;
|
||||
}
|
||||
93
frontend/style/node_modules/date-fns/_lib/format/formatters.js
generated
vendored
93
frontend/style/node_modules/date-fns/_lib/format/formatters.js
generated
vendored
@@ -1,13 +1,11 @@
|
||||
"use strict";
|
||||
exports.formatters = void 0;
|
||||
var _index = require("../../getDayOfYear.js");
|
||||
var _index2 = require("../../getISOWeek.js");
|
||||
var _index3 = require("../../getISOWeekYear.js");
|
||||
var _index4 = require("../../getWeek.js");
|
||||
var _index5 = require("../../getWeekYear.js");
|
||||
import { getDayOfYear } from "../../getDayOfYear.js";
|
||||
import { getISOWeek } from "../../getISOWeek.js";
|
||||
import { getISOWeekYear } from "../../getISOWeekYear.js";
|
||||
import { getWeek } from "../../getWeek.js";
|
||||
import { getWeekYear } from "../../getWeekYear.js";
|
||||
|
||||
var _index6 = require("../addLeadingZeros.js");
|
||||
var _index7 = require("./lightFormatters.js");
|
||||
import { addLeadingZeros } from "../addLeadingZeros.js";
|
||||
import { lightFormatters } from "./lightFormatters.js";
|
||||
|
||||
const dayPeriodEnum = {
|
||||
am: "am",
|
||||
@@ -66,7 +64,7 @@ const dayPeriodEnum = {
|
||||
* - `p` is long localized time format
|
||||
*/
|
||||
|
||||
const formatters = (exports.formatters = {
|
||||
export const formatters = {
|
||||
// Era
|
||||
G: function (date, token, localize) {
|
||||
const era = date.getFullYear() > 0 ? 1 : 0;
|
||||
@@ -96,19 +94,19 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(year, { unit: "year" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.y(date, token);
|
||||
return lightFormatters.y(date, token);
|
||||
},
|
||||
|
||||
// Local week-numbering year
|
||||
Y: function (date, token, localize, options) {
|
||||
const signedWeekYear = (0, _index5.getWeekYear)(date, options);
|
||||
const signedWeekYear = getWeekYear(date, options);
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
||||
|
||||
// Two digit year
|
||||
if (token === "YY") {
|
||||
const twoDigitYear = weekYear % 100;
|
||||
return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
|
||||
return addLeadingZeros(twoDigitYear, 2);
|
||||
}
|
||||
|
||||
// Ordinal number
|
||||
@@ -117,15 +115,15 @@ const formatters = (exports.formatters = {
|
||||
}
|
||||
|
||||
// Padding
|
||||
return (0, _index6.addLeadingZeros)(weekYear, token.length);
|
||||
return addLeadingZeros(weekYear, token.length);
|
||||
},
|
||||
|
||||
// ISO week-numbering year
|
||||
R: function (date, token) {
|
||||
const isoWeekYear = (0, _index3.getISOWeekYear)(date);
|
||||
const isoWeekYear = getISOWeekYear(date);
|
||||
|
||||
// Padding
|
||||
return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
|
||||
return addLeadingZeros(isoWeekYear, token.length);
|
||||
},
|
||||
|
||||
// Extended year. This is a single number designating the year of this calendar system.
|
||||
@@ -139,7 +137,7 @@ const formatters = (exports.formatters = {
|
||||
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
||||
u: function (date, token) {
|
||||
const year = date.getFullYear();
|
||||
return (0, _index6.addLeadingZeros)(year, token.length);
|
||||
return addLeadingZeros(year, token.length);
|
||||
},
|
||||
|
||||
// Quarter
|
||||
@@ -151,7 +149,7 @@ const formatters = (exports.formatters = {
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "QQ":
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
return addLeadingZeros(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "Qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
@@ -186,7 +184,7 @@ const formatters = (exports.formatters = {
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "qq":
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
return addLeadingZeros(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
@@ -218,7 +216,7 @@ const formatters = (exports.formatters = {
|
||||
switch (token) {
|
||||
case "M":
|
||||
case "MM":
|
||||
return _index7.lightFormatters.M(date, token);
|
||||
return lightFormatters.M(date, token);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Mo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
@@ -250,7 +248,7 @@ const formatters = (exports.formatters = {
|
||||
return String(month + 1);
|
||||
// 01, 02, ..., 12
|
||||
case "LL":
|
||||
return (0, _index6.addLeadingZeros)(month + 1, 2);
|
||||
return addLeadingZeros(month + 1, 2);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Lo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
@@ -275,24 +273,24 @@ const formatters = (exports.formatters = {
|
||||
|
||||
// Local week of year
|
||||
w: function (date, token, localize, options) {
|
||||
const week = (0, _index4.getWeek)(date, options);
|
||||
const week = getWeek(date, options);
|
||||
|
||||
if (token === "wo") {
|
||||
return localize.ordinalNumber(week, { unit: "week" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(week, token.length);
|
||||
return addLeadingZeros(week, token.length);
|
||||
},
|
||||
|
||||
// ISO week of year
|
||||
I: function (date, token, localize) {
|
||||
const isoWeek = (0, _index2.getISOWeek)(date);
|
||||
const isoWeek = getISOWeek(date);
|
||||
|
||||
if (token === "Io") {
|
||||
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(isoWeek, token.length);
|
||||
return addLeadingZeros(isoWeek, token.length);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
@@ -301,18 +299,18 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.d(date, token);
|
||||
return lightFormatters.d(date, token);
|
||||
},
|
||||
|
||||
// Day of year
|
||||
D: function (date, token, localize) {
|
||||
const dayOfYear = (0, _index.getDayOfYear)(date);
|
||||
const dayOfYear = getDayOfYear(date);
|
||||
|
||||
if (token === "Do") {
|
||||
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
|
||||
return addLeadingZeros(dayOfYear, token.length);
|
||||
},
|
||||
|
||||
// Day of week
|
||||
@@ -359,7 +357,7 @@ const formatters = (exports.formatters = {
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "ee":
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
|
||||
return addLeadingZeros(localDayOfWeek, 2);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "eo":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
@@ -400,7 +398,7 @@ const formatters = (exports.formatters = {
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "cc":
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
|
||||
return addLeadingZeros(localDayOfWeek, token.length);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "co":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
@@ -441,7 +439,7 @@ const formatters = (exports.formatters = {
|
||||
return String(isoDayOfWeek);
|
||||
// 02
|
||||
case "ii":
|
||||
return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
|
||||
return addLeadingZeros(isoDayOfWeek, token.length);
|
||||
// 2nd
|
||||
case "io":
|
||||
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
||||
@@ -590,7 +588,7 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.h(date, token);
|
||||
return lightFormatters.h(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
@@ -599,7 +597,7 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.H(date, token);
|
||||
return lightFormatters.H(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-11]
|
||||
@@ -610,7 +608,7 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
return addLeadingZeros(hours, token.length);
|
||||
},
|
||||
|
||||
// Hour [1-24]
|
||||
@@ -622,7 +620,7 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
return addLeadingZeros(hours, token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
@@ -631,7 +629,7 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.m(date, token);
|
||||
return lightFormatters.m(date, token);
|
||||
},
|
||||
|
||||
// Second
|
||||
@@ -640,12 +638,12 @@ const formatters = (exports.formatters = {
|
||||
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.s(date, token);
|
||||
return lightFormatters.s(date, token);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S: function (date, token) {
|
||||
return _index7.lightFormatters.S(date, token);
|
||||
return lightFormatters.S(date, token);
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
||||
@@ -740,16 +738,15 @@ const formatters = (exports.formatters = {
|
||||
|
||||
// Seconds timestamp
|
||||
t: function (date, token, _localize) {
|
||||
const timestamp = Math.trunc(date.getTime() / 1000);
|
||||
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
||||
const timestamp = Math.trunc(+date / 1000);
|
||||
return addLeadingZeros(timestamp, token.length);
|
||||
},
|
||||
|
||||
// Milliseconds timestamp
|
||||
T: function (date, token, _localize) {
|
||||
const timestamp = date.getTime();
|
||||
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
||||
return addLeadingZeros(+date, token.length);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function formatTimezoneShort(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
@@ -759,15 +756,13 @@ function formatTimezoneShort(offset, delimiter = "") {
|
||||
if (minutes === 0) {
|
||||
return sign + String(hours);
|
||||
}
|
||||
return (
|
||||
sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
|
||||
);
|
||||
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
||||
}
|
||||
|
||||
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
||||
if (offset % 60 === 0) {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
|
||||
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
||||
}
|
||||
return formatTimezone(offset, delimiter);
|
||||
}
|
||||
@@ -775,7 +770,7 @@ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
||||
function formatTimezone(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
const absOffset = Math.abs(offset);
|
||||
const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
|
||||
const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
|
||||
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
||||
const minutes = addLeadingZeros(absOffset % 60, 2);
|
||||
return sign + hours + delimiter + minutes;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { addLeadingZeros } from "../addLeadingZeros.mjs";
|
||||
"use strict";
|
||||
exports.lightFormatters = void 0;
|
||||
var _index = require("../addLeadingZeros.cjs");
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
@@ -13,7 +15,7 @@ import { addLeadingZeros } from "../addLeadingZeros.mjs";
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*/
|
||||
|
||||
export const lightFormatters = {
|
||||
const lightFormatters = (exports.lightFormatters = {
|
||||
// Year
|
||||
y(date, token) {
|
||||
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
||||
@@ -28,18 +30,23 @@ export const lightFormatters = {
|
||||
const signedYear = date.getFullYear();
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
||||
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
||||
return (0, _index.addLeadingZeros)(
|
||||
token === "yy" ? year % 100 : year,
|
||||
token.length,
|
||||
);
|
||||
},
|
||||
|
||||
// Month
|
||||
M(date, token) {
|
||||
const month = date.getMonth();
|
||||
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
||||
return token === "M"
|
||||
? String(month + 1)
|
||||
: (0, _index.addLeadingZeros)(month + 1, 2);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d(date, token) {
|
||||
return addLeadingZeros(date.getDate(), token.length);
|
||||
return (0, _index.addLeadingZeros)(date.getDate(), token.length);
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
@@ -62,22 +69,25 @@ export const lightFormatters = {
|
||||
|
||||
// Hour [1-12]
|
||||
h(date, token) {
|
||||
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
||||
return (0, _index.addLeadingZeros)(
|
||||
date.getHours() % 12 || 12,
|
||||
token.length,
|
||||
);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H(date, token) {
|
||||
return addLeadingZeros(date.getHours(), token.length);
|
||||
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m(date, token) {
|
||||
return addLeadingZeros(date.getMinutes(), token.length);
|
||||
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
|
||||
},
|
||||
|
||||
// Second
|
||||
s(date, token) {
|
||||
return addLeadingZeros(date.getSeconds(), token.length);
|
||||
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
@@ -87,6 +97,6 @@ export const lightFormatters = {
|
||||
const fractionalSeconds = Math.trunc(
|
||||
milliseconds * Math.pow(10, numberOfDigits - 3),
|
||||
);
|
||||
return addLeadingZeros(fractionalSeconds, token.length);
|
||||
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
|
||||
},
|
||||
};
|
||||
});
|
||||
32
frontend/style/node_modules/date-fns/_lib/format/lightFormatters.js
generated
vendored
32
frontend/style/node_modules/date-fns/_lib/format/lightFormatters.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.lightFormatters = void 0;
|
||||
var _index = require("../addLeadingZeros.js");
|
||||
import { addLeadingZeros } from "../addLeadingZeros.js";
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
@@ -15,7 +13,7 @@ var _index = require("../addLeadingZeros.js");
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*/
|
||||
|
||||
const lightFormatters = (exports.lightFormatters = {
|
||||
export const lightFormatters = {
|
||||
// Year
|
||||
y(date, token) {
|
||||
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
||||
@@ -30,23 +28,18 @@ const lightFormatters = (exports.lightFormatters = {
|
||||
const signedYear = date.getFullYear();
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
||||
return (0, _index.addLeadingZeros)(
|
||||
token === "yy" ? year % 100 : year,
|
||||
token.length,
|
||||
);
|
||||
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
||||
},
|
||||
|
||||
// Month
|
||||
M(date, token) {
|
||||
const month = date.getMonth();
|
||||
return token === "M"
|
||||
? String(month + 1)
|
||||
: (0, _index.addLeadingZeros)(month + 1, 2);
|
||||
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getDate(), token.length);
|
||||
return addLeadingZeros(date.getDate(), token.length);
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
@@ -69,25 +62,22 @@ const lightFormatters = (exports.lightFormatters = {
|
||||
|
||||
// Hour [1-12]
|
||||
h(date, token) {
|
||||
return (0, _index.addLeadingZeros)(
|
||||
date.getHours() % 12 || 12,
|
||||
token.length,
|
||||
);
|
||||
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
|
||||
return addLeadingZeros(date.getHours(), token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
|
||||
return addLeadingZeros(date.getMinutes(), token.length);
|
||||
},
|
||||
|
||||
// Second
|
||||
s(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
|
||||
return addLeadingZeros(date.getSeconds(), token.length);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
@@ -97,6 +87,6 @@ const lightFormatters = (exports.lightFormatters = {
|
||||
const fractionalSeconds = Math.trunc(
|
||||
milliseconds * Math.pow(10, numberOfDigits - 3),
|
||||
);
|
||||
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
|
||||
return addLeadingZeros(fractionalSeconds, token.length);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
"use strict";
|
||||
exports.longFormatters = void 0;
|
||||
|
||||
const dateLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "P":
|
||||
@@ -58,7 +61,7 @@ const dateTimeLongFormatter = (pattern, formatLong) => {
|
||||
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
||||
};
|
||||
|
||||
export const longFormatters = {
|
||||
const longFormatters = (exports.longFormatters = {
|
||||
p: timeLongFormatter,
|
||||
P: dateTimeLongFormatter,
|
||||
};
|
||||
});
|
||||
7
frontend/style/node_modules/date-fns/_lib/format/longFormatters.js
generated
vendored
7
frontend/style/node_modules/date-fns/_lib/format/longFormatters.js
generated
vendored
@@ -1,6 +1,3 @@
|
||||
"use strict";
|
||||
exports.longFormatters = void 0;
|
||||
|
||||
const dateLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "P":
|
||||
@@ -61,7 +58,7 @@ const dateTimeLongFormatter = (pattern, formatLong) => {
|
||||
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
||||
};
|
||||
|
||||
const longFormatters = (exports.longFormatters = {
|
||||
export const longFormatters = {
|
||||
p: timeLongFormatter,
|
||||
P: dateTimeLongFormatter,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export function getRoundingMethod(method) {
|
||||
"use strict";
|
||||
exports.getRoundingMethod = getRoundingMethod;
|
||||
|
||||
function getRoundingMethod(method) {
|
||||
return (number) => {
|
||||
const round = method ? Math[method] : Math.trunc;
|
||||
const result = round(number);
|
||||
5
frontend/style/node_modules/date-fns/_lib/getRoundingMethod.js
generated
vendored
5
frontend/style/node_modules/date-fns/_lib/getRoundingMethod.js
generated
vendored
@@ -1,7 +1,4 @@
|
||||
"use strict";
|
||||
exports.getRoundingMethod = getRoundingMethod;
|
||||
|
||||
function getRoundingMethod(method) {
|
||||
export function getRoundingMethod(method) {
|
||||
return (number) => {
|
||||
const round = method ? Math[method] : Math.trunc;
|
||||
const result = round(number);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { toDate } from "../toDate.mjs";
|
||||
"use strict";
|
||||
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
|
||||
var _index = require("../toDate.cjs");
|
||||
|
||||
/**
|
||||
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
||||
@@ -11,8 +13,8 @@ import { toDate } from "../toDate.mjs";
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = toDate(date);
|
||||
function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = (0, _index.toDate)(date);
|
||||
const utcDate = new Date(
|
||||
Date.UTC(
|
||||
_date.getFullYear(),
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { DateArg } from "../types.js";
|
||||
/**
|
||||
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
||||
* They usually appear for dates that denote time before the timezones were introduced
|
||||
@@ -10,5 +11,5 @@
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export declare function getTimezoneOffsetInMilliseconds(
|
||||
date: Date | number | string,
|
||||
date: DateArg<Date> & {},
|
||||
): number;
|
||||
3
frontend/style/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
generated
vendored
3
frontend/style/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
generated
vendored
@@ -1,3 +1,4 @@
|
||||
import type { DateArg } from "../types.js";
|
||||
/**
|
||||
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
||||
* They usually appear for dates that denote time before the timezones were introduced
|
||||
@@ -10,5 +11,5 @@
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export declare function getTimezoneOffsetInMilliseconds(
|
||||
date: Date | number | string,
|
||||
date: DateArg<Date> & {},
|
||||
): number;
|
||||
|
||||
8
frontend/style/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
generated
vendored
8
frontend/style/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
|
||||
var _index = require("../toDate.js");
|
||||
import { toDate } from "../toDate.js";
|
||||
|
||||
/**
|
||||
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
||||
@@ -13,8 +11,8 @@ var _index = require("../toDate.js");
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = (0, _index.toDate)(date);
|
||||
export function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = toDate(date);
|
||||
const utcDate = new Date(
|
||||
Date.UTC(
|
||||
_date.getFullYear(),
|
||||
|
||||
11
frontend/style/node_modules/date-fns/_lib/normalizeDates.cjs
generated
vendored
Normal file
11
frontend/style/node_modules/date-fns/_lib/normalizeDates.cjs
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
exports.normalizeDates = normalizeDates;
|
||||
var _index = require("../constructFrom.cjs");
|
||||
|
||||
function normalizeDates(context, ...dates) {
|
||||
const normalize = _index.constructFrom.bind(
|
||||
null,
|
||||
context || dates.find((date) => typeof date === "object"),
|
||||
);
|
||||
return dates.map(normalize);
|
||||
}
|
||||
13
frontend/style/node_modules/date-fns/_lib/normalizeDates.d.cts
generated
vendored
Normal file
13
frontend/style/node_modules/date-fns/_lib/normalizeDates.d.cts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { ContextFn, DateArg } from "../types.js";
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: [DateArg<Date>, DateArg<Date>, DateArg<Date>]
|
||||
): [Date, Date, Date];
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: [DateArg<Date>, DateArg<Date>]
|
||||
): [Date, Date];
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: Array<DateArg<Date> & {}>
|
||||
): Date[];
|
||||
13
frontend/style/node_modules/date-fns/_lib/normalizeDates.d.ts
generated
vendored
Normal file
13
frontend/style/node_modules/date-fns/_lib/normalizeDates.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { ContextFn, DateArg } from "../types.js";
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: [DateArg<Date>, DateArg<Date>, DateArg<Date>]
|
||||
): [Date, Date, Date];
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: [DateArg<Date>, DateArg<Date>]
|
||||
): [Date, Date];
|
||||
export declare function normalizeDates(
|
||||
context: ContextFn<Date> | undefined,
|
||||
...dates: Array<DateArg<Date> & {}>
|
||||
): Date[];
|
||||
9
frontend/style/node_modules/date-fns/_lib/normalizeDates.js
generated
vendored
Normal file
9
frontend/style/node_modules/date-fns/_lib/normalizeDates.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { constructFrom } from "../constructFrom.js";
|
||||
|
||||
export function normalizeDates(context, ...dates) {
|
||||
const normalize = constructFrom.bind(
|
||||
null,
|
||||
context || dates.find((date) => typeof date === "object"),
|
||||
);
|
||||
return dates.map(normalize);
|
||||
}
|
||||
12
frontend/style/node_modules/date-fns/_lib/normalizeInterval.cjs
generated
vendored
Normal file
12
frontend/style/node_modules/date-fns/_lib/normalizeInterval.cjs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
exports.normalizeInterval = normalizeInterval;
|
||||
var _index = require("./normalizeDates.cjs");
|
||||
|
||||
function normalizeInterval(context, interval) {
|
||||
const [start, end] = (0, _index.normalizeDates)(
|
||||
context,
|
||||
interval.start,
|
||||
interval.end,
|
||||
);
|
||||
return { start, end };
|
||||
}
|
||||
5
frontend/style/node_modules/date-fns/_lib/normalizeInterval.d.cts
generated
vendored
Normal file
5
frontend/style/node_modules/date-fns/_lib/normalizeInterval.d.cts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ContextFn, Interval, NormalizedInterval } from "../types.js";
|
||||
export declare function normalizeInterval(
|
||||
context: ContextFn<Date> | undefined,
|
||||
interval: Interval,
|
||||
): NormalizedInterval<Date>;
|
||||
5
frontend/style/node_modules/date-fns/_lib/normalizeInterval.d.ts
generated
vendored
Normal file
5
frontend/style/node_modules/date-fns/_lib/normalizeInterval.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ContextFn, Interval, NormalizedInterval } from "../types.js";
|
||||
export declare function normalizeInterval(
|
||||
context: ContextFn<Date> | undefined,
|
||||
interval: Interval,
|
||||
): NormalizedInterval<Date>;
|
||||
6
frontend/style/node_modules/date-fns/_lib/normalizeInterval.js
generated
vendored
Normal file
6
frontend/style/node_modules/date-fns/_lib/normalizeInterval.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { normalizeDates } from "./normalizeDates.js";
|
||||
|
||||
export function normalizeInterval(context, interval) {
|
||||
const [start, end] = normalizeDates(context, interval.start, interval.end);
|
||||
return { start, end };
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
"use strict";
|
||||
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
||||
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
||||
exports.warnOrThrowProtectedError = warnOrThrowProtectedError;
|
||||
const dayOfYearTokenRE = /^D+$/;
|
||||
const weekYearTokenRE = /^Y+$/;
|
||||
|
||||
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
||||
|
||||
export function isProtectedDayOfYearToken(token) {
|
||||
function isProtectedDayOfYearToken(token) {
|
||||
return dayOfYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
export function isProtectedWeekYearToken(token) {
|
||||
function isProtectedWeekYearToken(token) {
|
||||
return weekYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
export function warnOrThrowProtectedError(token, format, input) {
|
||||
function warnOrThrowProtectedError(token, format, input) {
|
||||
const _message = message(token, format, input);
|
||||
console.warn(_message);
|
||||
if (throwTokens.includes(token)) throw new RangeError(_message);
|
||||
10
frontend/style/node_modules/date-fns/_lib/protectedTokens.js
generated
vendored
10
frontend/style/node_modules/date-fns/_lib/protectedTokens.js
generated
vendored
@@ -1,21 +1,17 @@
|
||||
"use strict";
|
||||
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
||||
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
||||
exports.warnOrThrowProtectedError = warnOrThrowProtectedError;
|
||||
const dayOfYearTokenRE = /^D+$/;
|
||||
const weekYearTokenRE = /^Y+$/;
|
||||
|
||||
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
||||
|
||||
function isProtectedDayOfYearToken(token) {
|
||||
export function isProtectedDayOfYearToken(token) {
|
||||
return dayOfYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
function isProtectedWeekYearToken(token) {
|
||||
export function isProtectedWeekYearToken(token) {
|
||||
return weekYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
function warnOrThrowProtectedError(token, format, input) {
|
||||
export function warnOrThrowProtectedError(token, format, input) {
|
||||
const _message = message(token, format, input);
|
||||
console.warn(_message);
|
||||
if (throwTokens.includes(token)) throw new RangeError(_message);
|
||||
|
||||
59
frontend/style/node_modules/date-fns/_lib/test.cjs
generated
vendored
Normal file
59
frontend/style/node_modules/date-fns/_lib/test.cjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
exports.assertType = assertType;
|
||||
exports.fakeDate = fakeDate;
|
||||
exports.generateOffset = generateOffset;
|
||||
exports.resetDefaultOptions = resetDefaultOptions;
|
||||
var _vitest = require("./test/vitest");
|
||||
var _index = require("./addLeadingZeros.cjs");
|
||||
var _index2 = require("./defaultOptions.cjs");
|
||||
var _sinon = require("./test/sinon");
|
||||
|
||||
function assertType(_value) {}
|
||||
|
||||
function resetDefaultOptions() {
|
||||
(0, _index2.setDefaultOptions)({});
|
||||
}
|
||||
|
||||
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
|
||||
function generateOffset(originalDate) {
|
||||
// Add the timezone.
|
||||
let offset = "";
|
||||
const tzOffset = originalDate.getTimezoneOffset();
|
||||
|
||||
if (tzOffset !== 0) {
|
||||
const absoluteOffset = Math.abs(tzOffset);
|
||||
const hourOffset = (0, _index.addLeadingZeros)(
|
||||
Math.trunc(absoluteOffset / 60),
|
||||
2,
|
||||
);
|
||||
const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2);
|
||||
// If less than 0, the sign is +, because it is ahead of time.
|
||||
const sign = tzOffset < 0 ? "+" : "-";
|
||||
|
||||
offset = `${sign}${hourOffset}:${minuteOffset}`;
|
||||
} else {
|
||||
offset = "Z";
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
function fakeDate(date) {
|
||||
let clock;
|
||||
|
||||
function fakeNow(date) {
|
||||
clock?.restore();
|
||||
clock = _sinon.default.useFakeTimers(+date);
|
||||
}
|
||||
|
||||
(0, _vitest.beforeEach)(() => {
|
||||
fakeNow(+date);
|
||||
});
|
||||
|
||||
(0, _vitest.afterEach)(() => {
|
||||
clock?.restore();
|
||||
clock = undefined;
|
||||
});
|
||||
|
||||
return { fakeNow };
|
||||
}
|
||||
14
frontend/style/node_modules/date-fns/_lib/test.d.cts
generated
vendored
Normal file
14
frontend/style/node_modules/date-fns/_lib/test.d.cts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export declare function assertType<Type>(_value: Type): void;
|
||||
export declare namespace assertType {
|
||||
type Equal<T, U> =
|
||||
Exclude<T, U> extends never
|
||||
? Exclude<U, T> extends never
|
||||
? true
|
||||
: false
|
||||
: false;
|
||||
}
|
||||
export declare function resetDefaultOptions(): void;
|
||||
export declare function generateOffset(originalDate: Date): string;
|
||||
export declare function fakeDate(date: number | Date): {
|
||||
fakeNow: (date: number | Date) => void;
|
||||
};
|
||||
3
frontend/style/node_modules/date-fns/_lib/test.d.mts
generated
vendored
3
frontend/style/node_modules/date-fns/_lib/test.d.mts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export declare function assertType<T>(_: T): void;
|
||||
export declare function resetDefaultOptions(): void;
|
||||
export declare function generateOffset(originalDate: Date): string;
|
||||
13
frontend/style/node_modules/date-fns/_lib/test.d.ts
generated
vendored
13
frontend/style/node_modules/date-fns/_lib/test.d.ts
generated
vendored
@@ -1,3 +1,14 @@
|
||||
export declare function assertType<T>(_: T): void;
|
||||
export declare function assertType<Type>(_value: Type): void;
|
||||
export declare namespace assertType {
|
||||
type Equal<T, U> =
|
||||
Exclude<T, U> extends never
|
||||
? Exclude<U, T> extends never
|
||||
? true
|
||||
: false
|
||||
: false;
|
||||
}
|
||||
export declare function resetDefaultOptions(): void;
|
||||
export declare function generateOffset(originalDate: Date): string;
|
||||
export declare function fakeDate(date: number | Date): {
|
||||
fakeNow: (date: number | Date) => void;
|
||||
};
|
||||
|
||||
45
frontend/style/node_modules/date-fns/_lib/test.js
generated
vendored
45
frontend/style/node_modules/date-fns/_lib/test.js
generated
vendored
@@ -1,29 +1,24 @@
|
||||
"use strict";
|
||||
exports.assertType = assertType;
|
||||
exports.generateOffset = generateOffset;
|
||||
exports.resetDefaultOptions = resetDefaultOptions;
|
||||
var _index = require("./addLeadingZeros.js");
|
||||
var _index2 = require("./defaultOptions.js");
|
||||
import { afterEach, beforeEach } from "./test/vitest";
|
||||
import { addLeadingZeros } from "./addLeadingZeros.js";
|
||||
import { setDefaultOptions } from "./defaultOptions.js";
|
||||
import sinon from "./test/sinon";
|
||||
|
||||
function assertType(_) {}
|
||||
export function assertType(_value) {}
|
||||
|
||||
function resetDefaultOptions() {
|
||||
(0, _index2.setDefaultOptions)({});
|
||||
export function resetDefaultOptions() {
|
||||
setDefaultOptions({});
|
||||
}
|
||||
|
||||
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
|
||||
function generateOffset(originalDate) {
|
||||
export function generateOffset(originalDate) {
|
||||
// Add the timezone.
|
||||
let offset = "";
|
||||
const tzOffset = originalDate.getTimezoneOffset();
|
||||
|
||||
if (tzOffset !== 0) {
|
||||
const absoluteOffset = Math.abs(tzOffset);
|
||||
const hourOffset = (0, _index.addLeadingZeros)(
|
||||
Math.trunc(absoluteOffset / 60),
|
||||
2,
|
||||
);
|
||||
const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2);
|
||||
const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
|
||||
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
|
||||
// If less than 0, the sign is +, because it is ahead of time.
|
||||
const sign = tzOffset < 0 ? "+" : "-";
|
||||
|
||||
@@ -34,3 +29,23 @@ function generateOffset(originalDate) {
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
export function fakeDate(date) {
|
||||
let clock;
|
||||
|
||||
function fakeNow(date) {
|
||||
clock?.restore();
|
||||
clock = sinon.useFakeTimers(+date);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
fakeNow(+date);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
clock?.restore();
|
||||
clock = undefined;
|
||||
});
|
||||
|
||||
return { fakeNow };
|
||||
}
|
||||
|
||||
29
frontend/style/node_modules/date-fns/_lib/test.mjs
generated
vendored
29
frontend/style/node_modules/date-fns/_lib/test.mjs
generated
vendored
@@ -1,29 +0,0 @@
|
||||
import { addLeadingZeros } from "./addLeadingZeros.mjs";
|
||||
import { setDefaultOptions } from "./defaultOptions.mjs";
|
||||
|
||||
export function assertType(_) {}
|
||||
|
||||
export function resetDefaultOptions() {
|
||||
setDefaultOptions({});
|
||||
}
|
||||
|
||||
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
|
||||
export function generateOffset(originalDate) {
|
||||
// Add the timezone.
|
||||
let offset = "";
|
||||
const tzOffset = originalDate.getTimezoneOffset();
|
||||
|
||||
if (tzOffset !== 0) {
|
||||
const absoluteOffset = Math.abs(tzOffset);
|
||||
const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
|
||||
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
|
||||
// If less than 0, the sign is +, because it is ahead of time.
|
||||
const sign = tzOffset < 0 ? "+" : "-";
|
||||
|
||||
offset = `${sign}${hourOffset}:${minuteOffset}`;
|
||||
} else {
|
||||
offset = "Z";
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
Reference in New Issue
Block a user