v1.0 with SW PWA enabled
This commit is contained in:
2780
frontend/node_modules/date-fns/CHANGELOG.md
generated
vendored
Normal file
2780
frontend/node_modules/date-fns/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
frontend/node_modules/date-fns/LICENSE.md
generated
vendored
Normal file
21
frontend/node_modules/date-fns/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Sasha Koss and Lesha Koss https://kossnocorp.mit-license.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
59
frontend/node_modules/date-fns/README.md
generated
vendored
Normal file
59
frontend/node_modules/date-fns/README.md
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
🎉️ **NEW**: [date-fns v3 is out!](https://blog.date-fns.org/v3-is-out/)
|
||||
|
||||
<img alt="date-fns" title="date-fns" src="https://raw.githubusercontent.com/date-fns/date-fns/master/docs/logotype.svg" width="150" />
|
||||
|
||||
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js
|
||||
|
||||
👉 [Documentation](https://date-fns.org/)
|
||||
|
||||
👉 [Blog](https://blog.date-fns.org/)
|
||||
|
||||
<hr>
|
||||
|
||||
It's like [Lodash](https://lodash.com) for dates
|
||||
|
||||
- It has [**200+ functions** for all occasions](https://date-fns.org/docs/Getting-Started/).
|
||||
- **Modular**: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
|
||||
- **Native dates**: Uses existing native type. It doesn't extend core objects for safety's sake.
|
||||
- **Immutable & Pure**: Built using pure functions and always returns a new date instance.
|
||||
- **TypeScript**: The library is 100% TypeScript with brand-new handcrafted types.
|
||||
- **I18n**: Dozens of locales. Include only what you need.
|
||||
- [and many more benefits](https://date-fns.org/)
|
||||
|
||||
```js
|
||||
import { compareAsc, format } from "date-fns";
|
||||
|
||||
format(new Date(2014, 1, 11), "yyyy-MM-dd");
|
||||
//=> '2014-02-11'
|
||||
|
||||
const dates = [
|
||||
new Date(1995, 6, 2),
|
||||
new Date(1987, 1, 11),
|
||||
new Date(1989, 6, 10),
|
||||
];
|
||||
dates.sort(compareAsc);
|
||||
//=> [
|
||||
// Wed Feb 11 1987 00:00:00,
|
||||
// Mon Jul 10 1989 00:00:00,
|
||||
// Sun Jul 02 1995 00:00:00
|
||||
// ]
|
||||
```
|
||||
|
||||
The library is available as an [npm package](https://www.npmjs.com/package/date-fns).
|
||||
To install the package run:
|
||||
|
||||
```bash
|
||||
npm install date-fns --save
|
||||
```
|
||||
|
||||
## Docs
|
||||
|
||||
[See date-fns.org](https://date-fns.org/) for more details, API,
|
||||
and other docs.
|
||||
|
||||
<br />
|
||||
<!-- END OF README-JOB SECTION -->
|
||||
|
||||
## License
|
||||
|
||||
[MIT © Sasha Koss](https://kossnocorp.mit-license.org/)
|
||||
12
frontend/node_modules/date-fns/SECURITY.md
generated
vendored
Normal file
12
frontend/node_modules/date-fns/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Security updates are applied only to the latest release.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.**
|
||||
This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
|
||||
Please disclose it to [Sasha Koss](mailto:koss@nocorp.me). This project is maintained by a team of volunteers
|
||||
on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
|
||||
4
frontend/node_modules/date-fns/_lib/addLeadingZeros.d.mts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/addLeadingZeros.d.mts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export declare function addLeadingZeros(
|
||||
number: number,
|
||||
targetLength: number,
|
||||
): string;
|
||||
4
frontend/node_modules/date-fns/_lib/addLeadingZeros.d.ts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/addLeadingZeros.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export declare function addLeadingZeros(
|
||||
number: number,
|
||||
targetLength: number,
|
||||
): string;
|
||||
7
frontend/node_modules/date-fns/_lib/addLeadingZeros.js
generated
vendored
Normal file
7
frontend/node_modules/date-fns/_lib/addLeadingZeros.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"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;
|
||||
}
|
||||
5
frontend/node_modules/date-fns/_lib/addLeadingZeros.mjs
generated
vendored
Normal file
5
frontend/node_modules/date-fns/_lib/addLeadingZeros.mjs
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export function addLeadingZeros(number, targetLength) {
|
||||
const sign = number < 0 ? "-" : "";
|
||||
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
||||
return sign + output;
|
||||
}
|
||||
1
frontend/node_modules/date-fns/_lib/defaultLocale.d.mts
generated
vendored
Normal file
1
frontend/node_modules/date-fns/_lib/defaultLocale.d.mts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { enUS as defaultLocale } from "../locale/en-US.js";
|
||||
1
frontend/node_modules/date-fns/_lib/defaultLocale.d.ts
generated
vendored
Normal file
1
frontend/node_modules/date-fns/_lib/defaultLocale.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { enUS as defaultLocale } from "../locale/en-US.js";
|
||||
8
frontend/node_modules/date-fns/_lib/defaultLocale.js
generated
vendored
Normal file
8
frontend/node_modules/date-fns/_lib/defaultLocale.js
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.js");
|
||||
1
frontend/node_modules/date-fns/_lib/defaultLocale.mjs
generated
vendored
Normal file
1
frontend/node_modules/date-fns/_lib/defaultLocale.mjs
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { enUS as defaultLocale } from "../locale/en-US.mjs";
|
||||
11
frontend/node_modules/date-fns/_lib/defaultOptions.d.mts
generated
vendored
Normal file
11
frontend/node_modules/date-fns/_lib/defaultOptions.d.mts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import type {
|
||||
FirstWeekContainsDateOptions,
|
||||
Locale,
|
||||
LocalizedOptions,
|
||||
WeekOptions,
|
||||
} from "../types.js";
|
||||
export type DefaultOptions = LocalizedOptions<keyof Locale> &
|
||||
WeekOptions &
|
||||
FirstWeekContainsDateOptions;
|
||||
export declare function getDefaultOptions(): DefaultOptions;
|
||||
export declare function setDefaultOptions(newOptions: DefaultOptions): void;
|
||||
11
frontend/node_modules/date-fns/_lib/defaultOptions.d.ts
generated
vendored
Normal file
11
frontend/node_modules/date-fns/_lib/defaultOptions.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import type {
|
||||
FirstWeekContainsDateOptions,
|
||||
Locale,
|
||||
LocalizedOptions,
|
||||
WeekOptions,
|
||||
} from "../types.js";
|
||||
export type DefaultOptions = LocalizedOptions<keyof Locale> &
|
||||
WeekOptions &
|
||||
FirstWeekContainsDateOptions;
|
||||
export declare function getDefaultOptions(): DefaultOptions;
|
||||
export declare function setDefaultOptions(newOptions: DefaultOptions): void;
|
||||
13
frontend/node_modules/date-fns/_lib/defaultOptions.js
generated
vendored
Normal file
13
frontend/node_modules/date-fns/_lib/defaultOptions.js
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;
|
||||
}
|
||||
9
frontend/node_modules/date-fns/_lib/defaultOptions.mjs
generated
vendored
Normal file
9
frontend/node_modules/date-fns/_lib/defaultOptions.mjs
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
let defaultOptions = {};
|
||||
|
||||
export function getDefaultOptions() {
|
||||
return defaultOptions;
|
||||
}
|
||||
|
||||
export function setDefaultOptions(newOptions) {
|
||||
defaultOptions = newOptions;
|
||||
}
|
||||
18
frontend/node_modules/date-fns/_lib/format/formatters.d.mts
generated
vendored
Normal file
18
frontend/node_modules/date-fns/_lib/format/formatters.d.mts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import type { Localize } from "../../locale/types.js";
|
||||
import type {
|
||||
FirstWeekContainsDateOptions,
|
||||
LocalizedOptions,
|
||||
WeekOptions,
|
||||
} from "../../types.js";
|
||||
type Formatter = (
|
||||
date: Date,
|
||||
token: string,
|
||||
localize: Localize,
|
||||
options: Required<
|
||||
LocalizedOptions<"options"> & WeekOptions & FirstWeekContainsDateOptions
|
||||
>,
|
||||
) => string;
|
||||
export declare const formatters: {
|
||||
[token: string]: Formatter;
|
||||
};
|
||||
export {};
|
||||
18
frontend/node_modules/date-fns/_lib/format/formatters.d.ts
generated
vendored
Normal file
18
frontend/node_modules/date-fns/_lib/format/formatters.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import type { Localize } from "../../locale/types.js";
|
||||
import type {
|
||||
FirstWeekContainsDateOptions,
|
||||
LocalizedOptions,
|
||||
WeekOptions,
|
||||
} from "../../types.js";
|
||||
type Formatter = (
|
||||
date: Date,
|
||||
token: string,
|
||||
localize: Localize,
|
||||
options: Required<
|
||||
LocalizedOptions<"options"> & WeekOptions & FirstWeekContainsDateOptions
|
||||
>,
|
||||
) => string;
|
||||
export declare const formatters: {
|
||||
[token: string]: Formatter;
|
||||
};
|
||||
export {};
|
||||
781
frontend/node_modules/date-fns/_lib/format/formatters.js
generated
vendored
Normal file
781
frontend/node_modules/date-fns/_lib/format/formatters.js
generated
vendored
Normal file
@ -0,0 +1,781 @@
|
||||
"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");
|
||||
|
||||
var _index6 = require("../addLeadingZeros.js");
|
||||
var _index7 = require("./lightFormatters.js");
|
||||
|
||||
const dayPeriodEnum = {
|
||||
am: "am",
|
||||
pm: "pm",
|
||||
midnight: "midnight",
|
||||
noon: "noon",
|
||||
morning: "morning",
|
||||
afternoon: "afternoon",
|
||||
evening: "evening",
|
||||
night: "night",
|
||||
};
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
* |-----|--------------------------------|-----|--------------------------------|
|
||||
* | a | AM, PM | A* | Milliseconds in day |
|
||||
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
||||
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
||||
* | d | Day of month | D | Day of year |
|
||||
* | e | Local day of week | E | Day of week |
|
||||
* | f | | F* | Day of week in month |
|
||||
* | g* | Modified Julian day | G | Era |
|
||||
* | h | Hour [1-12] | H | Hour [0-23] |
|
||||
* | i! | ISO day of week | I! | ISO week of year |
|
||||
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
||||
* | k | Hour [1-24] | K | Hour [0-11] |
|
||||
* | l* | (deprecated) | L | Stand-alone month |
|
||||
* | m | Minute | M | Month |
|
||||
* | n | | N | |
|
||||
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
||||
* | p! | Long localized time | P! | Long localized date |
|
||||
* | q | Stand-alone quarter | Q | Quarter |
|
||||
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
||||
* | s | Second | S | Fraction of second |
|
||||
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
||||
* | u | Extended year | U* | Cyclic year |
|
||||
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
||||
* | w | Local week of year | W* | Week of month |
|
||||
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
||||
* | y | Year (abs) | Y | Local week-numbering year |
|
||||
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
||||
*
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*
|
||||
* Letters marked by ! are non-standard, but implemented by date-fns:
|
||||
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
||||
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
||||
* i.e. 7 for Sunday, 1 for Monday, etc.
|
||||
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
||||
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
||||
* `R` is supposed to be used in conjunction with `I` and `i`
|
||||
* for universal ISO week-numbering date, whereas
|
||||
* `Y` is supposed to be used in conjunction with `w` and `e`
|
||||
* for week-numbering date specific to the locale.
|
||||
* - `P` is long localized date format
|
||||
* - `p` is long localized time format
|
||||
*/
|
||||
|
||||
const formatters = (exports.formatters = {
|
||||
// Era
|
||||
G: function (date, token, localize) {
|
||||
const era = date.getFullYear() > 0 ? 1 : 0;
|
||||
switch (token) {
|
||||
// AD, BC
|
||||
case "G":
|
||||
case "GG":
|
||||
case "GGG":
|
||||
return localize.era(era, { width: "abbreviated" });
|
||||
// A, B
|
||||
case "GGGGG":
|
||||
return localize.era(era, { width: "narrow" });
|
||||
// Anno Domini, Before Christ
|
||||
case "GGGG":
|
||||
default:
|
||||
return localize.era(era, { width: "wide" });
|
||||
}
|
||||
},
|
||||
|
||||
// Year
|
||||
y: function (date, token, localize) {
|
||||
// Ordinal number
|
||||
if (token === "yo") {
|
||||
const signedYear = date.getFullYear();
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
||||
return localize.ordinalNumber(year, { unit: "year" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.y(date, token);
|
||||
},
|
||||
|
||||
// Local week-numbering year
|
||||
Y: function (date, token, localize, 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 (0, _index6.addLeadingZeros)(twoDigitYear, 2);
|
||||
}
|
||||
|
||||
// Ordinal number
|
||||
if (token === "Yo") {
|
||||
return localize.ordinalNumber(weekYear, { unit: "year" });
|
||||
}
|
||||
|
||||
// Padding
|
||||
return (0, _index6.addLeadingZeros)(weekYear, token.length);
|
||||
},
|
||||
|
||||
// ISO week-numbering year
|
||||
R: function (date, token) {
|
||||
const isoWeekYear = (0, _index3.getISOWeekYear)(date);
|
||||
|
||||
// Padding
|
||||
return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
|
||||
},
|
||||
|
||||
// Extended year. This is a single number designating the year of this calendar system.
|
||||
// The main difference between `y` and `u` localizers are B.C. years:
|
||||
// | Year | `y` | `u` |
|
||||
// |------|-----|-----|
|
||||
// | AC 1 | 1 | 1 |
|
||||
// | BC 1 | 1 | 0 |
|
||||
// | BC 2 | 2 | -1 |
|
||||
// Also `yy` always returns the last two digits of a year,
|
||||
// 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);
|
||||
},
|
||||
|
||||
// Quarter
|
||||
Q: function (date, token, localize) {
|
||||
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
||||
switch (token) {
|
||||
// 1, 2, 3, 4
|
||||
case "Q":
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "QQ":
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "Qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
// Q1, Q2, Q3, Q4
|
||||
case "QQQ":
|
||||
return localize.quarter(quarter, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
||||
case "QQQQQ":
|
||||
return localize.quarter(quarter, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// 1st quarter, 2nd quarter, ...
|
||||
case "QQQQ":
|
||||
default:
|
||||
return localize.quarter(quarter, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone quarter
|
||||
q: function (date, token, localize) {
|
||||
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
||||
switch (token) {
|
||||
// 1, 2, 3, 4
|
||||
case "q":
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "qq":
|
||||
return (0, _index6.addLeadingZeros)(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
// Q1, Q2, Q3, Q4
|
||||
case "qqq":
|
||||
return localize.quarter(quarter, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
||||
case "qqqqq":
|
||||
return localize.quarter(quarter, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// 1st quarter, 2nd quarter, ...
|
||||
case "qqqq":
|
||||
default:
|
||||
return localize.quarter(quarter, {
|
||||
width: "wide",
|
||||
context: "standalone",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Month
|
||||
M: function (date, token, localize) {
|
||||
const month = date.getMonth();
|
||||
switch (token) {
|
||||
case "M":
|
||||
case "MM":
|
||||
return _index7.lightFormatters.M(date, token);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Mo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
// Jan, Feb, ..., Dec
|
||||
case "MMM":
|
||||
return localize.month(month, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// J, F, ..., D
|
||||
case "MMMMM":
|
||||
return localize.month(month, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// January, February, ..., December
|
||||
case "MMMM":
|
||||
default:
|
||||
return localize.month(month, { width: "wide", context: "formatting" });
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone month
|
||||
L: function (date, token, localize) {
|
||||
const month = date.getMonth();
|
||||
switch (token) {
|
||||
// 1, 2, ..., 12
|
||||
case "L":
|
||||
return String(month + 1);
|
||||
// 01, 02, ..., 12
|
||||
case "LL":
|
||||
return (0, _index6.addLeadingZeros)(month + 1, 2);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Lo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
// Jan, Feb, ..., Dec
|
||||
case "LLL":
|
||||
return localize.month(month, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// J, F, ..., D
|
||||
case "LLLLL":
|
||||
return localize.month(month, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// January, February, ..., December
|
||||
case "LLLL":
|
||||
default:
|
||||
return localize.month(month, { width: "wide", context: "standalone" });
|
||||
}
|
||||
},
|
||||
|
||||
// Local week of year
|
||||
w: function (date, token, localize, options) {
|
||||
const week = (0, _index4.getWeek)(date, options);
|
||||
|
||||
if (token === "wo") {
|
||||
return localize.ordinalNumber(week, { unit: "week" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(week, token.length);
|
||||
},
|
||||
|
||||
// ISO week of year
|
||||
I: function (date, token, localize) {
|
||||
const isoWeek = (0, _index2.getISOWeek)(date);
|
||||
|
||||
if (token === "Io") {
|
||||
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(isoWeek, token.length);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d: function (date, token, localize) {
|
||||
if (token === "do") {
|
||||
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.d(date, token);
|
||||
},
|
||||
|
||||
// Day of year
|
||||
D: function (date, token, localize) {
|
||||
const dayOfYear = (0, _index.getDayOfYear)(date);
|
||||
|
||||
if (token === "Do") {
|
||||
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
|
||||
},
|
||||
|
||||
// Day of week
|
||||
E: function (date, token, localize) {
|
||||
const dayOfWeek = date.getDay();
|
||||
switch (token) {
|
||||
// Tue
|
||||
case "E":
|
||||
case "EE":
|
||||
case "EEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "EEEEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "EEEEEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "EEEE":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Local day of week
|
||||
e: function (date, token, localize, options) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
||||
switch (token) {
|
||||
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
||||
case "e":
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "ee":
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "eo":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
case "eee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "eeeee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "eeeeee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "eeee":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone local day of week
|
||||
c: function (date, token, localize, options) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
||||
switch (token) {
|
||||
// Numerical value (same as in `e`)
|
||||
case "c":
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "cc":
|
||||
return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "co":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
case "ccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// T
|
||||
case "ccccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// Tu
|
||||
case "cccccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "standalone",
|
||||
});
|
||||
// Tuesday
|
||||
case "cccc":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "standalone",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// ISO day of week
|
||||
i: function (date, token, localize) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
||||
switch (token) {
|
||||
// 2
|
||||
case "i":
|
||||
return String(isoDayOfWeek);
|
||||
// 02
|
||||
case "ii":
|
||||
return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
|
||||
// 2nd
|
||||
case "io":
|
||||
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
||||
// Tue
|
||||
case "iii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "iiiii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "iiiiii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "iiii":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
a: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
||||
|
||||
switch (token) {
|
||||
case "a":
|
||||
case "aa":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "aaa":
|
||||
return localize
|
||||
.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
})
|
||||
.toLowerCase();
|
||||
case "aaaaa":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "aaaa":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// AM, PM, midnight, noon
|
||||
b: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
let dayPeriodEnumValue;
|
||||
if (hours === 12) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.noon;
|
||||
} else if (hours === 0) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
||||
} else {
|
||||
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
case "b":
|
||||
case "bb":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "bbb":
|
||||
return localize
|
||||
.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
})
|
||||
.toLowerCase();
|
||||
case "bbbbb":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "bbbb":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// in the morning, in the afternoon, in the evening, at night
|
||||
B: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
let dayPeriodEnumValue;
|
||||
if (hours >= 17) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.evening;
|
||||
} else if (hours >= 12) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
||||
} else if (hours >= 4) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.morning;
|
||||
} else {
|
||||
dayPeriodEnumValue = dayPeriodEnum.night;
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
case "B":
|
||||
case "BB":
|
||||
case "BBB":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "BBBBB":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "BBBB":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Hour [1-12]
|
||||
h: function (date, token, localize) {
|
||||
if (token === "ho") {
|
||||
let hours = date.getHours() % 12;
|
||||
if (hours === 0) hours = 12;
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.h(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H: function (date, token, localize) {
|
||||
if (token === "Ho") {
|
||||
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.H(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-11]
|
||||
K: function (date, token, localize) {
|
||||
const hours = date.getHours() % 12;
|
||||
|
||||
if (token === "Ko") {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
},
|
||||
|
||||
// Hour [1-24]
|
||||
k: function (date, token, localize) {
|
||||
let hours = date.getHours();
|
||||
if (hours === 0) hours = 24;
|
||||
|
||||
if (token === "ko") {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return (0, _index6.addLeadingZeros)(hours, token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m: function (date, token, localize) {
|
||||
if (token === "mo") {
|
||||
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.m(date, token);
|
||||
},
|
||||
|
||||
// Second
|
||||
s: function (date, token, localize) {
|
||||
if (token === "so") {
|
||||
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
||||
}
|
||||
|
||||
return _index7.lightFormatters.s(date, token);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S: function (date, token) {
|
||||
return _index7.lightFormatters.S(date, token);
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
||||
X: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
if (timezoneOffset === 0) {
|
||||
return "Z";
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
// Hours and optional minutes
|
||||
case "X":
|
||||
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds without `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `XX`
|
||||
case "XXXX":
|
||||
case "XX": // Hours and minutes without `:` delimiter
|
||||
return formatTimezone(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds with `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `XXX`
|
||||
case "XXXXX":
|
||||
case "XXX": // Hours and minutes with `:` delimiter
|
||||
default:
|
||||
return formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
||||
x: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Hours and optional minutes
|
||||
case "x":
|
||||
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds without `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `xx`
|
||||
case "xxxx":
|
||||
case "xx": // Hours and minutes without `:` delimiter
|
||||
return formatTimezone(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds with `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `xxx`
|
||||
case "xxxxx":
|
||||
case "xxx": // Hours and minutes with `:` delimiter
|
||||
default:
|
||||
return formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (GMT)
|
||||
O: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Short
|
||||
case "O":
|
||||
case "OO":
|
||||
case "OOO":
|
||||
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
||||
// Long
|
||||
case "OOOO":
|
||||
default:
|
||||
return "GMT" + formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (specific non-location)
|
||||
z: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Short
|
||||
case "z":
|
||||
case "zz":
|
||||
case "zzz":
|
||||
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
||||
// Long
|
||||
case "zzzz":
|
||||
default:
|
||||
return "GMT" + formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Seconds timestamp
|
||||
t: function (date, token, _localize) {
|
||||
const timestamp = Math.trunc(date.getTime() / 1000);
|
||||
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
||||
},
|
||||
|
||||
// Milliseconds timestamp
|
||||
T: function (date, token, _localize) {
|
||||
const timestamp = date.getTime();
|
||||
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
||||
},
|
||||
});
|
||||
|
||||
function formatTimezoneShort(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
const absOffset = Math.abs(offset);
|
||||
const hours = Math.trunc(absOffset / 60);
|
||||
const minutes = absOffset % 60;
|
||||
if (minutes === 0) {
|
||||
return sign + String(hours);
|
||||
}
|
||||
return (
|
||||
sign + String(hours) + delimiter + (0, _index6.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 formatTimezone(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);
|
||||
return sign + hours + delimiter + minutes;
|
||||
}
|
||||
776
frontend/node_modules/date-fns/_lib/format/formatters.mjs
generated
vendored
Normal file
776
frontend/node_modules/date-fns/_lib/format/formatters.mjs
generated
vendored
Normal file
@ -0,0 +1,776 @@
|
||||
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";
|
||||
|
||||
const dayPeriodEnum = {
|
||||
am: "am",
|
||||
pm: "pm",
|
||||
midnight: "midnight",
|
||||
noon: "noon",
|
||||
morning: "morning",
|
||||
afternoon: "afternoon",
|
||||
evening: "evening",
|
||||
night: "night",
|
||||
};
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
* |-----|--------------------------------|-----|--------------------------------|
|
||||
* | a | AM, PM | A* | Milliseconds in day |
|
||||
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
||||
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
||||
* | d | Day of month | D | Day of year |
|
||||
* | e | Local day of week | E | Day of week |
|
||||
* | f | | F* | Day of week in month |
|
||||
* | g* | Modified Julian day | G | Era |
|
||||
* | h | Hour [1-12] | H | Hour [0-23] |
|
||||
* | i! | ISO day of week | I! | ISO week of year |
|
||||
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
||||
* | k | Hour [1-24] | K | Hour [0-11] |
|
||||
* | l* | (deprecated) | L | Stand-alone month |
|
||||
* | m | Minute | M | Month |
|
||||
* | n | | N | |
|
||||
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
||||
* | p! | Long localized time | P! | Long localized date |
|
||||
* | q | Stand-alone quarter | Q | Quarter |
|
||||
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
||||
* | s | Second | S | Fraction of second |
|
||||
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
||||
* | u | Extended year | U* | Cyclic year |
|
||||
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
||||
* | w | Local week of year | W* | Week of month |
|
||||
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
||||
* | y | Year (abs) | Y | Local week-numbering year |
|
||||
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
||||
*
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*
|
||||
* Letters marked by ! are non-standard, but implemented by date-fns:
|
||||
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
||||
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
||||
* i.e. 7 for Sunday, 1 for Monday, etc.
|
||||
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
||||
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
||||
* `R` is supposed to be used in conjunction with `I` and `i`
|
||||
* for universal ISO week-numbering date, whereas
|
||||
* `Y` is supposed to be used in conjunction with `w` and `e`
|
||||
* for week-numbering date specific to the locale.
|
||||
* - `P` is long localized date format
|
||||
* - `p` is long localized time format
|
||||
*/
|
||||
|
||||
export const formatters = {
|
||||
// Era
|
||||
G: function (date, token, localize) {
|
||||
const era = date.getFullYear() > 0 ? 1 : 0;
|
||||
switch (token) {
|
||||
// AD, BC
|
||||
case "G":
|
||||
case "GG":
|
||||
case "GGG":
|
||||
return localize.era(era, { width: "abbreviated" });
|
||||
// A, B
|
||||
case "GGGGG":
|
||||
return localize.era(era, { width: "narrow" });
|
||||
// Anno Domini, Before Christ
|
||||
case "GGGG":
|
||||
default:
|
||||
return localize.era(era, { width: "wide" });
|
||||
}
|
||||
},
|
||||
|
||||
// Year
|
||||
y: function (date, token, localize) {
|
||||
// Ordinal number
|
||||
if (token === "yo") {
|
||||
const signedYear = date.getFullYear();
|
||||
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
||||
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
||||
return localize.ordinalNumber(year, { unit: "year" });
|
||||
}
|
||||
|
||||
return lightFormatters.y(date, token);
|
||||
},
|
||||
|
||||
// Local week-numbering year
|
||||
Y: function (date, token, localize, 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 addLeadingZeros(twoDigitYear, 2);
|
||||
}
|
||||
|
||||
// Ordinal number
|
||||
if (token === "Yo") {
|
||||
return localize.ordinalNumber(weekYear, { unit: "year" });
|
||||
}
|
||||
|
||||
// Padding
|
||||
return addLeadingZeros(weekYear, token.length);
|
||||
},
|
||||
|
||||
// ISO week-numbering year
|
||||
R: function (date, token) {
|
||||
const isoWeekYear = getISOWeekYear(date);
|
||||
|
||||
// Padding
|
||||
return addLeadingZeros(isoWeekYear, token.length);
|
||||
},
|
||||
|
||||
// Extended year. This is a single number designating the year of this calendar system.
|
||||
// The main difference between `y` and `u` localizers are B.C. years:
|
||||
// | Year | `y` | `u` |
|
||||
// |------|-----|-----|
|
||||
// | AC 1 | 1 | 1 |
|
||||
// | BC 1 | 1 | 0 |
|
||||
// | BC 2 | 2 | -1 |
|
||||
// Also `yy` always returns the last two digits of a year,
|
||||
// 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);
|
||||
},
|
||||
|
||||
// Quarter
|
||||
Q: function (date, token, localize) {
|
||||
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
||||
switch (token) {
|
||||
// 1, 2, 3, 4
|
||||
case "Q":
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "QQ":
|
||||
return addLeadingZeros(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "Qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
// Q1, Q2, Q3, Q4
|
||||
case "QQQ":
|
||||
return localize.quarter(quarter, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
||||
case "QQQQQ":
|
||||
return localize.quarter(quarter, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// 1st quarter, 2nd quarter, ...
|
||||
case "QQQQ":
|
||||
default:
|
||||
return localize.quarter(quarter, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone quarter
|
||||
q: function (date, token, localize) {
|
||||
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
||||
switch (token) {
|
||||
// 1, 2, 3, 4
|
||||
case "q":
|
||||
return String(quarter);
|
||||
// 01, 02, 03, 04
|
||||
case "qq":
|
||||
return addLeadingZeros(quarter, 2);
|
||||
// 1st, 2nd, 3rd, 4th
|
||||
case "qo":
|
||||
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
||||
// Q1, Q2, Q3, Q4
|
||||
case "qqq":
|
||||
return localize.quarter(quarter, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
||||
case "qqqqq":
|
||||
return localize.quarter(quarter, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// 1st quarter, 2nd quarter, ...
|
||||
case "qqqq":
|
||||
default:
|
||||
return localize.quarter(quarter, {
|
||||
width: "wide",
|
||||
context: "standalone",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Month
|
||||
M: function (date, token, localize) {
|
||||
const month = date.getMonth();
|
||||
switch (token) {
|
||||
case "M":
|
||||
case "MM":
|
||||
return lightFormatters.M(date, token);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Mo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
// Jan, Feb, ..., Dec
|
||||
case "MMM":
|
||||
return localize.month(month, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// J, F, ..., D
|
||||
case "MMMMM":
|
||||
return localize.month(month, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// January, February, ..., December
|
||||
case "MMMM":
|
||||
default:
|
||||
return localize.month(month, { width: "wide", context: "formatting" });
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone month
|
||||
L: function (date, token, localize) {
|
||||
const month = date.getMonth();
|
||||
switch (token) {
|
||||
// 1, 2, ..., 12
|
||||
case "L":
|
||||
return String(month + 1);
|
||||
// 01, 02, ..., 12
|
||||
case "LL":
|
||||
return addLeadingZeros(month + 1, 2);
|
||||
// 1st, 2nd, ..., 12th
|
||||
case "Lo":
|
||||
return localize.ordinalNumber(month + 1, { unit: "month" });
|
||||
// Jan, Feb, ..., Dec
|
||||
case "LLL":
|
||||
return localize.month(month, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// J, F, ..., D
|
||||
case "LLLLL":
|
||||
return localize.month(month, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// January, February, ..., December
|
||||
case "LLLL":
|
||||
default:
|
||||
return localize.month(month, { width: "wide", context: "standalone" });
|
||||
}
|
||||
},
|
||||
|
||||
// Local week of year
|
||||
w: function (date, token, localize, options) {
|
||||
const week = getWeek(date, options);
|
||||
|
||||
if (token === "wo") {
|
||||
return localize.ordinalNumber(week, { unit: "week" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(week, token.length);
|
||||
},
|
||||
|
||||
// ISO week of year
|
||||
I: function (date, token, localize) {
|
||||
const isoWeek = getISOWeek(date);
|
||||
|
||||
if (token === "Io") {
|
||||
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(isoWeek, token.length);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d: function (date, token, localize) {
|
||||
if (token === "do") {
|
||||
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
||||
}
|
||||
|
||||
return lightFormatters.d(date, token);
|
||||
},
|
||||
|
||||
// Day of year
|
||||
D: function (date, token, localize) {
|
||||
const dayOfYear = getDayOfYear(date);
|
||||
|
||||
if (token === "Do") {
|
||||
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(dayOfYear, token.length);
|
||||
},
|
||||
|
||||
// Day of week
|
||||
E: function (date, token, localize) {
|
||||
const dayOfWeek = date.getDay();
|
||||
switch (token) {
|
||||
// Tue
|
||||
case "E":
|
||||
case "EE":
|
||||
case "EEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "EEEEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "EEEEEE":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "EEEE":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Local day of week
|
||||
e: function (date, token, localize, options) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
||||
switch (token) {
|
||||
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
||||
case "e":
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "ee":
|
||||
return addLeadingZeros(localDayOfWeek, 2);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "eo":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
case "eee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "eeeee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "eeeeee":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "eeee":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Stand-alone local day of week
|
||||
c: function (date, token, localize, options) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
||||
switch (token) {
|
||||
// Numerical value (same as in `e`)
|
||||
case "c":
|
||||
return String(localDayOfWeek);
|
||||
// Padded numerical value
|
||||
case "cc":
|
||||
return addLeadingZeros(localDayOfWeek, token.length);
|
||||
// 1st, 2nd, ..., 7th
|
||||
case "co":
|
||||
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
||||
case "ccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "standalone",
|
||||
});
|
||||
// T
|
||||
case "ccccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "standalone",
|
||||
});
|
||||
// Tu
|
||||
case "cccccc":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "standalone",
|
||||
});
|
||||
// Tuesday
|
||||
case "cccc":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "standalone",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// ISO day of week
|
||||
i: function (date, token, localize) {
|
||||
const dayOfWeek = date.getDay();
|
||||
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
||||
switch (token) {
|
||||
// 2
|
||||
case "i":
|
||||
return String(isoDayOfWeek);
|
||||
// 02
|
||||
case "ii":
|
||||
return addLeadingZeros(isoDayOfWeek, token.length);
|
||||
// 2nd
|
||||
case "io":
|
||||
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
||||
// Tue
|
||||
case "iii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
// T
|
||||
case "iiiii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tu
|
||||
case "iiiiii":
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "short",
|
||||
context: "formatting",
|
||||
});
|
||||
// Tuesday
|
||||
case "iiii":
|
||||
default:
|
||||
return localize.day(dayOfWeek, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
a: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
||||
|
||||
switch (token) {
|
||||
case "a":
|
||||
case "aa":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "aaa":
|
||||
return localize
|
||||
.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
})
|
||||
.toLowerCase();
|
||||
case "aaaaa":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "aaaa":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// AM, PM, midnight, noon
|
||||
b: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
let dayPeriodEnumValue;
|
||||
if (hours === 12) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.noon;
|
||||
} else if (hours === 0) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
||||
} else {
|
||||
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
case "b":
|
||||
case "bb":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "bbb":
|
||||
return localize
|
||||
.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
})
|
||||
.toLowerCase();
|
||||
case "bbbbb":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "bbbb":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// in the morning, in the afternoon, in the evening, at night
|
||||
B: function (date, token, localize) {
|
||||
const hours = date.getHours();
|
||||
let dayPeriodEnumValue;
|
||||
if (hours >= 17) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.evening;
|
||||
} else if (hours >= 12) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
||||
} else if (hours >= 4) {
|
||||
dayPeriodEnumValue = dayPeriodEnum.morning;
|
||||
} else {
|
||||
dayPeriodEnumValue = dayPeriodEnum.night;
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
case "B":
|
||||
case "BB":
|
||||
case "BBB":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "abbreviated",
|
||||
context: "formatting",
|
||||
});
|
||||
case "BBBBB":
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "narrow",
|
||||
context: "formatting",
|
||||
});
|
||||
case "BBBB":
|
||||
default:
|
||||
return localize.dayPeriod(dayPeriodEnumValue, {
|
||||
width: "wide",
|
||||
context: "formatting",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Hour [1-12]
|
||||
h: function (date, token, localize) {
|
||||
if (token === "ho") {
|
||||
let hours = date.getHours() % 12;
|
||||
if (hours === 0) hours = 12;
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return lightFormatters.h(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H: function (date, token, localize) {
|
||||
if (token === "Ho") {
|
||||
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
||||
}
|
||||
|
||||
return lightFormatters.H(date, token);
|
||||
},
|
||||
|
||||
// Hour [0-11]
|
||||
K: function (date, token, localize) {
|
||||
const hours = date.getHours() % 12;
|
||||
|
||||
if (token === "Ko") {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(hours, token.length);
|
||||
},
|
||||
|
||||
// Hour [1-24]
|
||||
k: function (date, token, localize) {
|
||||
let hours = date.getHours();
|
||||
if (hours === 0) hours = 24;
|
||||
|
||||
if (token === "ko") {
|
||||
return localize.ordinalNumber(hours, { unit: "hour" });
|
||||
}
|
||||
|
||||
return addLeadingZeros(hours, token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m: function (date, token, localize) {
|
||||
if (token === "mo") {
|
||||
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
||||
}
|
||||
|
||||
return lightFormatters.m(date, token);
|
||||
},
|
||||
|
||||
// Second
|
||||
s: function (date, token, localize) {
|
||||
if (token === "so") {
|
||||
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
||||
}
|
||||
|
||||
return lightFormatters.s(date, token);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S: function (date, token) {
|
||||
return lightFormatters.S(date, token);
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
||||
X: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
if (timezoneOffset === 0) {
|
||||
return "Z";
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
// Hours and optional minutes
|
||||
case "X":
|
||||
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds without `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `XX`
|
||||
case "XXXX":
|
||||
case "XX": // Hours and minutes without `:` delimiter
|
||||
return formatTimezone(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds with `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `XXX`
|
||||
case "XXXXX":
|
||||
case "XXX": // Hours and minutes with `:` delimiter
|
||||
default:
|
||||
return formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
||||
x: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Hours and optional minutes
|
||||
case "x":
|
||||
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds without `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `xx`
|
||||
case "xxxx":
|
||||
case "xx": // Hours and minutes without `:` delimiter
|
||||
return formatTimezone(timezoneOffset);
|
||||
|
||||
// Hours, minutes and optional seconds with `:` delimiter
|
||||
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
||||
// so this token always has the same output as `xxx`
|
||||
case "xxxxx":
|
||||
case "xxx": // Hours and minutes with `:` delimiter
|
||||
default:
|
||||
return formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (GMT)
|
||||
O: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Short
|
||||
case "O":
|
||||
case "OO":
|
||||
case "OOO":
|
||||
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
||||
// Long
|
||||
case "OOOO":
|
||||
default:
|
||||
return "GMT" + formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Timezone (specific non-location)
|
||||
z: function (date, token, _localize) {
|
||||
const timezoneOffset = date.getTimezoneOffset();
|
||||
|
||||
switch (token) {
|
||||
// Short
|
||||
case "z":
|
||||
case "zz":
|
||||
case "zzz":
|
||||
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
||||
// Long
|
||||
case "zzzz":
|
||||
default:
|
||||
return "GMT" + formatTimezone(timezoneOffset, ":");
|
||||
}
|
||||
},
|
||||
|
||||
// Seconds timestamp
|
||||
t: function (date, token, _localize) {
|
||||
const timestamp = Math.trunc(date.getTime() / 1000);
|
||||
return addLeadingZeros(timestamp, token.length);
|
||||
},
|
||||
|
||||
// Milliseconds timestamp
|
||||
T: function (date, token, _localize) {
|
||||
const timestamp = date.getTime();
|
||||
return addLeadingZeros(timestamp, token.length);
|
||||
},
|
||||
};
|
||||
|
||||
function formatTimezoneShort(offset, delimiter = "") {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
const absOffset = Math.abs(offset);
|
||||
const hours = Math.trunc(absOffset / 60);
|
||||
const minutes = absOffset % 60;
|
||||
if (minutes === 0) {
|
||||
return sign + String(hours);
|
||||
}
|
||||
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
||||
}
|
||||
|
||||
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
||||
if (offset % 60 === 0) {
|
||||
const sign = offset > 0 ? "-" : "+";
|
||||
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
||||
}
|
||||
return formatTimezone(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);
|
||||
return sign + hours + delimiter + minutes;
|
||||
}
|
||||
11
frontend/node_modules/date-fns/_lib/format/lightFormatters.d.mts
generated
vendored
Normal file
11
frontend/node_modules/date-fns/_lib/format/lightFormatters.d.mts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare const lightFormatters: {
|
||||
y(date: Date, token: string): string;
|
||||
M(date: Date, token: string): string;
|
||||
d(date: Date, token: string): string;
|
||||
a(date: Date, token: string): string;
|
||||
h(date: Date, token: string): string;
|
||||
H(date: Date, token: string): string;
|
||||
m(date: Date, token: string): string;
|
||||
s(date: Date, token: string): string;
|
||||
S(date: Date, token: string): string;
|
||||
};
|
||||
11
frontend/node_modules/date-fns/_lib/format/lightFormatters.d.ts
generated
vendored
Normal file
11
frontend/node_modules/date-fns/_lib/format/lightFormatters.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare const lightFormatters: {
|
||||
y(date: Date, token: string): string;
|
||||
M(date: Date, token: string): string;
|
||||
d(date: Date, token: string): string;
|
||||
a(date: Date, token: string): string;
|
||||
h(date: Date, token: string): string;
|
||||
H(date: Date, token: string): string;
|
||||
m(date: Date, token: string): string;
|
||||
s(date: Date, token: string): string;
|
||||
S(date: Date, token: string): string;
|
||||
};
|
||||
102
frontend/node_modules/date-fns/_lib/format/lightFormatters.js
generated
vendored
Normal file
102
frontend/node_modules/date-fns/_lib/format/lightFormatters.js
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
exports.lightFormatters = void 0;
|
||||
var _index = require("../addLeadingZeros.js");
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
* |-----|--------------------------------|-----|--------------------------------|
|
||||
* | a | AM, PM | A* | |
|
||||
* | d | Day of month | D | |
|
||||
* | h | Hour [1-12] | H | Hour [0-23] |
|
||||
* | m | Minute | M | Month |
|
||||
* | s | Second | S | Fraction of second |
|
||||
* | y | Year (abs) | Y | |
|
||||
*
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*/
|
||||
|
||||
const lightFormatters = (exports.lightFormatters = {
|
||||
// Year
|
||||
y(date, token) {
|
||||
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
||||
// | Year | y | yy | yyy | yyyy | yyyyy |
|
||||
// |----------|-------|----|-------|-------|-------|
|
||||
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
||||
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
||||
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
||||
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
||||
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
||||
|
||||
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,
|
||||
);
|
||||
},
|
||||
|
||||
// Month
|
||||
M(date, token) {
|
||||
const month = date.getMonth();
|
||||
return token === "M"
|
||||
? String(month + 1)
|
||||
: (0, _index.addLeadingZeros)(month + 1, 2);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getDate(), token.length);
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
a(date, token) {
|
||||
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
||||
|
||||
switch (token) {
|
||||
case "a":
|
||||
case "aa":
|
||||
return dayPeriodEnumValue.toUpperCase();
|
||||
case "aaa":
|
||||
return dayPeriodEnumValue;
|
||||
case "aaaaa":
|
||||
return dayPeriodEnumValue[0];
|
||||
case "aaaa":
|
||||
default:
|
||||
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
||||
}
|
||||
},
|
||||
|
||||
// Hour [1-12]
|
||||
h(date, token) {
|
||||
return (0, _index.addLeadingZeros)(
|
||||
date.getHours() % 12 || 12,
|
||||
token.length,
|
||||
);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
|
||||
},
|
||||
|
||||
// Second
|
||||
s(date, token) {
|
||||
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S(date, token) {
|
||||
const numberOfDigits = token.length;
|
||||
const milliseconds = date.getMilliseconds();
|
||||
const fractionalSeconds = Math.trunc(
|
||||
milliseconds * Math.pow(10, numberOfDigits - 3),
|
||||
);
|
||||
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
|
||||
},
|
||||
});
|
||||
92
frontend/node_modules/date-fns/_lib/format/lightFormatters.mjs
generated
vendored
Normal file
92
frontend/node_modules/date-fns/_lib/format/lightFormatters.mjs
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
import { addLeadingZeros } from "../addLeadingZeros.mjs";
|
||||
|
||||
/*
|
||||
* | | Unit | | Unit |
|
||||
* |-----|--------------------------------|-----|--------------------------------|
|
||||
* | a | AM, PM | A* | |
|
||||
* | d | Day of month | D | |
|
||||
* | h | Hour [1-12] | H | Hour [0-23] |
|
||||
* | m | Minute | M | Month |
|
||||
* | s | Second | S | Fraction of second |
|
||||
* | y | Year (abs) | Y | |
|
||||
*
|
||||
* Letters marked by * are not implemented but reserved by Unicode standard.
|
||||
*/
|
||||
|
||||
export const lightFormatters = {
|
||||
// Year
|
||||
y(date, token) {
|
||||
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
||||
// | Year | y | yy | yyy | yyyy | yyyyy |
|
||||
// |----------|-------|----|-------|-------|-------|
|
||||
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
||||
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
||||
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
||||
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
||||
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
||||
|
||||
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);
|
||||
},
|
||||
|
||||
// Month
|
||||
M(date, token) {
|
||||
const month = date.getMonth();
|
||||
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
||||
},
|
||||
|
||||
// Day of the month
|
||||
d(date, token) {
|
||||
return addLeadingZeros(date.getDate(), token.length);
|
||||
},
|
||||
|
||||
// AM or PM
|
||||
a(date, token) {
|
||||
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
||||
|
||||
switch (token) {
|
||||
case "a":
|
||||
case "aa":
|
||||
return dayPeriodEnumValue.toUpperCase();
|
||||
case "aaa":
|
||||
return dayPeriodEnumValue;
|
||||
case "aaaaa":
|
||||
return dayPeriodEnumValue[0];
|
||||
case "aaaa":
|
||||
default:
|
||||
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
||||
}
|
||||
},
|
||||
|
||||
// Hour [1-12]
|
||||
h(date, token) {
|
||||
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
||||
},
|
||||
|
||||
// Hour [0-23]
|
||||
H(date, token) {
|
||||
return addLeadingZeros(date.getHours(), token.length);
|
||||
},
|
||||
|
||||
// Minute
|
||||
m(date, token) {
|
||||
return addLeadingZeros(date.getMinutes(), token.length);
|
||||
},
|
||||
|
||||
// Second
|
||||
s(date, token) {
|
||||
return addLeadingZeros(date.getSeconds(), token.length);
|
||||
},
|
||||
|
||||
// Fraction of second
|
||||
S(date, token) {
|
||||
const numberOfDigits = token.length;
|
||||
const milliseconds = date.getMilliseconds();
|
||||
const fractionalSeconds = Math.trunc(
|
||||
milliseconds * Math.pow(10, numberOfDigits - 3),
|
||||
);
|
||||
return addLeadingZeros(fractionalSeconds, token.length);
|
||||
},
|
||||
};
|
||||
4
frontend/node_modules/date-fns/_lib/format/longFormatters.d.mts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/format/longFormatters.d.mts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import type { FormatLong } from "../../locale/types.js";
|
||||
type LongFormatter = (pattern: string, formatLong: FormatLong) => string;
|
||||
export declare const longFormatters: Record<string, LongFormatter>;
|
||||
export {};
|
||||
4
frontend/node_modules/date-fns/_lib/format/longFormatters.d.ts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/format/longFormatters.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import type { FormatLong } from "../../locale/types.js";
|
||||
type LongFormatter = (pattern: string, formatLong: FormatLong) => string;
|
||||
export declare const longFormatters: Record<string, LongFormatter>;
|
||||
export {};
|
||||
67
frontend/node_modules/date-fns/_lib/format/longFormatters.js
generated
vendored
Normal file
67
frontend/node_modules/date-fns/_lib/format/longFormatters.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
exports.longFormatters = void 0;
|
||||
|
||||
const dateLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "P":
|
||||
return formatLong.date({ width: "short" });
|
||||
case "PP":
|
||||
return formatLong.date({ width: "medium" });
|
||||
case "PPP":
|
||||
return formatLong.date({ width: "long" });
|
||||
case "PPPP":
|
||||
default:
|
||||
return formatLong.date({ width: "full" });
|
||||
}
|
||||
};
|
||||
|
||||
const timeLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "p":
|
||||
return formatLong.time({ width: "short" });
|
||||
case "pp":
|
||||
return formatLong.time({ width: "medium" });
|
||||
case "ppp":
|
||||
return formatLong.time({ width: "long" });
|
||||
case "pppp":
|
||||
default:
|
||||
return formatLong.time({ width: "full" });
|
||||
}
|
||||
};
|
||||
|
||||
const dateTimeLongFormatter = (pattern, formatLong) => {
|
||||
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
||||
const datePattern = matchResult[1];
|
||||
const timePattern = matchResult[2];
|
||||
|
||||
if (!timePattern) {
|
||||
return dateLongFormatter(pattern, formatLong);
|
||||
}
|
||||
|
||||
let dateTimeFormat;
|
||||
|
||||
switch (datePattern) {
|
||||
case "P":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "short" });
|
||||
break;
|
||||
case "PP":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "medium" });
|
||||
break;
|
||||
case "PPP":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
||||
break;
|
||||
case "PPPP":
|
||||
default:
|
||||
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
||||
break;
|
||||
}
|
||||
|
||||
return dateTimeFormat
|
||||
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
|
||||
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
||||
};
|
||||
|
||||
const longFormatters = (exports.longFormatters = {
|
||||
p: timeLongFormatter,
|
||||
P: dateTimeLongFormatter,
|
||||
});
|
||||
64
frontend/node_modules/date-fns/_lib/format/longFormatters.mjs
generated
vendored
Normal file
64
frontend/node_modules/date-fns/_lib/format/longFormatters.mjs
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
const dateLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "P":
|
||||
return formatLong.date({ width: "short" });
|
||||
case "PP":
|
||||
return formatLong.date({ width: "medium" });
|
||||
case "PPP":
|
||||
return formatLong.date({ width: "long" });
|
||||
case "PPPP":
|
||||
default:
|
||||
return formatLong.date({ width: "full" });
|
||||
}
|
||||
};
|
||||
|
||||
const timeLongFormatter = (pattern, formatLong) => {
|
||||
switch (pattern) {
|
||||
case "p":
|
||||
return formatLong.time({ width: "short" });
|
||||
case "pp":
|
||||
return formatLong.time({ width: "medium" });
|
||||
case "ppp":
|
||||
return formatLong.time({ width: "long" });
|
||||
case "pppp":
|
||||
default:
|
||||
return formatLong.time({ width: "full" });
|
||||
}
|
||||
};
|
||||
|
||||
const dateTimeLongFormatter = (pattern, formatLong) => {
|
||||
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
||||
const datePattern = matchResult[1];
|
||||
const timePattern = matchResult[2];
|
||||
|
||||
if (!timePattern) {
|
||||
return dateLongFormatter(pattern, formatLong);
|
||||
}
|
||||
|
||||
let dateTimeFormat;
|
||||
|
||||
switch (datePattern) {
|
||||
case "P":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "short" });
|
||||
break;
|
||||
case "PP":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "medium" });
|
||||
break;
|
||||
case "PPP":
|
||||
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
||||
break;
|
||||
case "PPPP":
|
||||
default:
|
||||
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
||||
break;
|
||||
}
|
||||
|
||||
return dateTimeFormat
|
||||
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
|
||||
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
||||
};
|
||||
|
||||
export const longFormatters = {
|
||||
p: timeLongFormatter,
|
||||
P: dateTimeLongFormatter,
|
||||
};
|
||||
4
frontend/node_modules/date-fns/_lib/getRoundingMethod.d.mts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/getRoundingMethod.d.mts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import type { RoundingMethod } from "../types.js";
|
||||
export declare function getRoundingMethod(
|
||||
method: RoundingMethod | undefined,
|
||||
): (number: number) => number;
|
||||
4
frontend/node_modules/date-fns/_lib/getRoundingMethod.d.ts
generated
vendored
Normal file
4
frontend/node_modules/date-fns/_lib/getRoundingMethod.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import type { RoundingMethod } from "../types.js";
|
||||
export declare function getRoundingMethod(
|
||||
method: RoundingMethod | undefined,
|
||||
): (number: number) => number;
|
||||
11
frontend/node_modules/date-fns/_lib/getRoundingMethod.js
generated
vendored
Normal file
11
frontend/node_modules/date-fns/_lib/getRoundingMethod.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
exports.getRoundingMethod = getRoundingMethod;
|
||||
|
||||
function getRoundingMethod(method) {
|
||||
return (number) => {
|
||||
const round = method ? Math[method] : Math.trunc;
|
||||
const result = round(number);
|
||||
// Prevent negative zero
|
||||
return result === 0 ? 0 : result;
|
||||
};
|
||||
}
|
||||
8
frontend/node_modules/date-fns/_lib/getRoundingMethod.mjs
generated
vendored
Normal file
8
frontend/node_modules/date-fns/_lib/getRoundingMethod.mjs
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
export function getRoundingMethod(method) {
|
||||
return (number) => {
|
||||
const round = method ? Math[method] : Math.trunc;
|
||||
const result = round(number);
|
||||
// Prevent negative zero
|
||||
return result === 0 ? 0 : result;
|
||||
};
|
||||
}
|
||||
14
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.mts
generated
vendored
Normal file
14
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.mts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 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
|
||||
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
||||
* and GMT+01:00:00 after that date)
|
||||
*
|
||||
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
||||
* which would lead to incorrect calculations.
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export declare function getTimezoneOffsetInMilliseconds(
|
||||
date: Date | number | string,
|
||||
): number;
|
||||
14
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
generated
vendored
Normal file
14
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 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
|
||||
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
||||
* and GMT+01:00:00 after that date)
|
||||
*
|
||||
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
||||
* which would lead to incorrect calculations.
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export declare function getTimezoneOffsetInMilliseconds(
|
||||
date: Date | number | string,
|
||||
): number;
|
||||
31
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
generated
vendored
Normal file
31
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
|
||||
var _index = require("../toDate.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
|
||||
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
||||
* and GMT+01:00:00 after that date)
|
||||
*
|
||||
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
||||
* which would lead to incorrect calculations.
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = (0, _index.toDate)(date);
|
||||
const utcDate = new Date(
|
||||
Date.UTC(
|
||||
_date.getFullYear(),
|
||||
_date.getMonth(),
|
||||
_date.getDate(),
|
||||
_date.getHours(),
|
||||
_date.getMinutes(),
|
||||
_date.getSeconds(),
|
||||
_date.getMilliseconds(),
|
||||
),
|
||||
);
|
||||
utcDate.setUTCFullYear(_date.getFullYear());
|
||||
return +date - +utcDate;
|
||||
}
|
||||
29
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { toDate } from "../toDate.mjs";
|
||||
|
||||
/**
|
||||
* 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
|
||||
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
||||
* and GMT+01:00:00 after that date)
|
||||
*
|
||||
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
||||
* which would lead to incorrect calculations.
|
||||
*
|
||||
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
||||
*/
|
||||
export function getTimezoneOffsetInMilliseconds(date) {
|
||||
const _date = toDate(date);
|
||||
const utcDate = new Date(
|
||||
Date.UTC(
|
||||
_date.getFullYear(),
|
||||
_date.getMonth(),
|
||||
_date.getDate(),
|
||||
_date.getHours(),
|
||||
_date.getMinutes(),
|
||||
_date.getSeconds(),
|
||||
_date.getMilliseconds(),
|
||||
),
|
||||
);
|
||||
utcDate.setUTCFullYear(_date.getFullYear());
|
||||
return +date - +utcDate;
|
||||
}
|
||||
7
frontend/node_modules/date-fns/_lib/protectedTokens.d.mts
generated
vendored
Normal file
7
frontend/node_modules/date-fns/_lib/protectedTokens.d.mts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export declare function isProtectedDayOfYearToken(token: string): boolean;
|
||||
export declare function isProtectedWeekYearToken(token: string): boolean;
|
||||
export declare function warnOrThrowProtectedError(
|
||||
token: string,
|
||||
format: string,
|
||||
input: string,
|
||||
): void;
|
||||
7
frontend/node_modules/date-fns/_lib/protectedTokens.d.ts
generated
vendored
Normal file
7
frontend/node_modules/date-fns/_lib/protectedTokens.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export declare function isProtectedDayOfYearToken(token: string): boolean;
|
||||
export declare function isProtectedWeekYearToken(token: string): boolean;
|
||||
export declare function warnOrThrowProtectedError(
|
||||
token: string,
|
||||
format: string,
|
||||
input: string,
|
||||
): void;
|
||||
27
frontend/node_modules/date-fns/_lib/protectedTokens.js
generated
vendored
Normal file
27
frontend/node_modules/date-fns/_lib/protectedTokens.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"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) {
|
||||
return dayOfYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
function isProtectedWeekYearToken(token) {
|
||||
return weekYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
function warnOrThrowProtectedError(token, format, input) {
|
||||
const _message = message(token, format, input);
|
||||
console.warn(_message);
|
||||
if (throwTokens.includes(token)) throw new RangeError(_message);
|
||||
}
|
||||
|
||||
function message(token, format, input) {
|
||||
const subject = token[0] === "Y" ? "years" : "days of the month";
|
||||
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
||||
}
|
||||
23
frontend/node_modules/date-fns/_lib/protectedTokens.mjs
generated
vendored
Normal file
23
frontend/node_modules/date-fns/_lib/protectedTokens.mjs
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
const dayOfYearTokenRE = /^D+$/;
|
||||
const weekYearTokenRE = /^Y+$/;
|
||||
|
||||
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
||||
|
||||
export function isProtectedDayOfYearToken(token) {
|
||||
return dayOfYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
export function isProtectedWeekYearToken(token) {
|
||||
return weekYearTokenRE.test(token);
|
||||
}
|
||||
|
||||
export function warnOrThrowProtectedError(token, format, input) {
|
||||
const _message = message(token, format, input);
|
||||
console.warn(_message);
|
||||
if (throwTokens.includes(token)) throw new RangeError(_message);
|
||||
}
|
||||
|
||||
function message(token, format, input) {
|
||||
const subject = token[0] === "Y" ? "years" : "days of the month";
|
||||
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
||||
}
|
||||
3
frontend/node_modules/date-fns/_lib/test.d.mts
generated
vendored
Normal file
3
frontend/node_modules/date-fns/_lib/test.d.mts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare function assertType<T>(_: T): void;
|
||||
export declare function resetDefaultOptions(): void;
|
||||
export declare function generateOffset(originalDate: Date): string;
|
||||
3
frontend/node_modules/date-fns/_lib/test.d.ts
generated
vendored
Normal file
3
frontend/node_modules/date-fns/_lib/test.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare function assertType<T>(_: T): void;
|
||||
export declare function resetDefaultOptions(): void;
|
||||
export declare function generateOffset(originalDate: Date): string;
|
||||
36
frontend/node_modules/date-fns/_lib/test.js
generated
vendored
Normal file
36
frontend/node_modules/date-fns/_lib/test.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
exports.assertType = assertType;
|
||||
exports.generateOffset = generateOffset;
|
||||
exports.resetDefaultOptions = resetDefaultOptions;
|
||||
var _index = require("./addLeadingZeros.js");
|
||||
var _index2 = require("./defaultOptions.js");
|
||||
|
||||
function assertType(_) {}
|
||||
|
||||
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;
|
||||
}
|
||||
29
frontend/node_modules/date-fns/_lib/test.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/_lib/test.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
45
frontend/node_modules/date-fns/add.d.mts
generated
vendored
Normal file
45
frontend/node_modules/date-fns/add.d.mts
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import type { Duration } from "./types.js";
|
||||
/**
|
||||
* @name add
|
||||
* @category Common Helpers
|
||||
* @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified years, months, weeks, days, hours, minutes and seconds to 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 date to be changed
|
||||
* @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.
|
||||
*
|
||||
* | Key | Description |
|
||||
* |----------------|------------------------------------|
|
||||
* | years | Amount of years to be added |
|
||||
* | months | Amount of months to be added |
|
||||
* | weeks | Amount of weeks to be added |
|
||||
* | days | Amount of days to be added |
|
||||
* | hours | Amount of hours to be added |
|
||||
* | minutes | Amount of minutes to be added |
|
||||
* | seconds | Amount of seconds to be added |
|
||||
*
|
||||
* All values default to 0
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add the following duration to 1 September 2014, 10:19:50
|
||||
* const result = add(new Date(2014, 8, 1, 10, 19, 50), {
|
||||
* years: 2,
|
||||
* months: 9,
|
||||
* weeks: 1,
|
||||
* days: 7,
|
||||
* hours: 5,\\-7
|
||||
* minutes: 9,
|
||||
* seconds: 30,
|
||||
* })
|
||||
* //=> Thu Jun 15 2017 15:29:20
|
||||
*/
|
||||
export declare function add<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
duration: Duration,
|
||||
): DateType;
|
||||
45
frontend/node_modules/date-fns/add.d.ts
generated
vendored
Normal file
45
frontend/node_modules/date-fns/add.d.ts
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import type { Duration } from "./types.js";
|
||||
/**
|
||||
* @name add
|
||||
* @category Common Helpers
|
||||
* @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified years, months, weeks, days, hours, minutes and seconds to 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 date to be changed
|
||||
* @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.
|
||||
*
|
||||
* | Key | Description |
|
||||
* |----------------|------------------------------------|
|
||||
* | years | Amount of years to be added |
|
||||
* | months | Amount of months to be added |
|
||||
* | weeks | Amount of weeks to be added |
|
||||
* | days | Amount of days to be added |
|
||||
* | hours | Amount of hours to be added |
|
||||
* | minutes | Amount of minutes to be added |
|
||||
* | seconds | Amount of seconds to be added |
|
||||
*
|
||||
* All values default to 0
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add the following duration to 1 September 2014, 10:19:50
|
||||
* const result = add(new Date(2014, 8, 1, 10, 19, 50), {
|
||||
* years: 2,
|
||||
* months: 9,
|
||||
* weeks: 1,
|
||||
* days: 7,
|
||||
* hours: 5,\\-7
|
||||
* minutes: 9,
|
||||
* seconds: 30,
|
||||
* })
|
||||
* //=> Thu Jun 15 2017 15:29:20
|
||||
*/
|
||||
export declare function add<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
duration: Duration,
|
||||
): DateType;
|
||||
82
frontend/node_modules/date-fns/add.js
generated
vendored
Normal file
82
frontend/node_modules/date-fns/add.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
exports.add = add;
|
||||
var _index = require("./addDays.js");
|
||||
var _index2 = require("./addMonths.js");
|
||||
var _index3 = require("./constructFrom.js");
|
||||
var _index4 = require("./toDate.js");
|
||||
|
||||
/**
|
||||
* @name add
|
||||
* @category Common Helpers
|
||||
* @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified years, months, weeks, days, hours, minutes and seconds to 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 date to be changed
|
||||
* @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.
|
||||
*
|
||||
* | Key | Description |
|
||||
* |----------------|------------------------------------|
|
||||
* | years | Amount of years to be added |
|
||||
* | months | Amount of months to be added |
|
||||
* | weeks | Amount of weeks to be added |
|
||||
* | days | Amount of days to be added |
|
||||
* | hours | Amount of hours to be added |
|
||||
* | minutes | Amount of minutes to be added |
|
||||
* | seconds | Amount of seconds to be added |
|
||||
*
|
||||
* All values default to 0
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add the following duration to 1 September 2014, 10:19:50
|
||||
* const result = add(new Date(2014, 8, 1, 10, 19, 50), {
|
||||
* years: 2,
|
||||
* months: 9,
|
||||
* weeks: 1,
|
||||
* days: 7,
|
||||
* hours: 5,\\-7
|
||||
* minutes: 9,
|
||||
* seconds: 30,
|
||||
* })
|
||||
* //=> Thu Jun 15 2017 15:29:20
|
||||
*/
|
||||
function add(date, duration) {
|
||||
const {
|
||||
years = 0,
|
||||
months = 0,
|
||||
weeks = 0,
|
||||
days = 0,
|
||||
hours = 0,
|
||||
minutes = 0,
|
||||
seconds = 0,
|
||||
} = duration;
|
||||
|
||||
// Add years and months
|
||||
const _date = (0, _index4.toDate)(date);
|
||||
const dateWithMonths =
|
||||
months || years
|
||||
? (0, _index2.addMonths)(_date, months + years * 12)
|
||||
: _date;
|
||||
|
||||
// Add weeks and days
|
||||
const dateWithDays =
|
||||
days || weeks
|
||||
? (0, _index.addDays)(dateWithMonths, days + weeks * 7)
|
||||
: dateWithMonths;
|
||||
|
||||
// Add days, hours, minutes and seconds
|
||||
const minutesToAdd = minutes + hours * 60;
|
||||
const secondsToAdd = seconds + minutesToAdd * 60;
|
||||
const msToAdd = secondsToAdd * 1000;
|
||||
const finalDate = (0, _index3.constructFrom)(
|
||||
date,
|
||||
dateWithDays.getTime() + msToAdd,
|
||||
);
|
||||
|
||||
return finalDate;
|
||||
}
|
||||
76
frontend/node_modules/date-fns/add.mjs
generated
vendored
Normal file
76
frontend/node_modules/date-fns/add.mjs
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
import { addDays } from "./addDays.mjs";
|
||||
import { addMonths } from "./addMonths.mjs";
|
||||
import { constructFrom } from "./constructFrom.mjs";
|
||||
import { toDate } from "./toDate.mjs";
|
||||
|
||||
/**
|
||||
* @name add
|
||||
* @category Common Helpers
|
||||
* @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified years, months, weeks, days, hours, minutes and seconds to 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 date to be changed
|
||||
* @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.
|
||||
*
|
||||
* | Key | Description |
|
||||
* |----------------|------------------------------------|
|
||||
* | years | Amount of years to be added |
|
||||
* | months | Amount of months to be added |
|
||||
* | weeks | Amount of weeks to be added |
|
||||
* | days | Amount of days to be added |
|
||||
* | hours | Amount of hours to be added |
|
||||
* | minutes | Amount of minutes to be added |
|
||||
* | seconds | Amount of seconds to be added |
|
||||
*
|
||||
* All values default to 0
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add the following duration to 1 September 2014, 10:19:50
|
||||
* const result = add(new Date(2014, 8, 1, 10, 19, 50), {
|
||||
* years: 2,
|
||||
* months: 9,
|
||||
* weeks: 1,
|
||||
* days: 7,
|
||||
* hours: 5,\\-7
|
||||
* minutes: 9,
|
||||
* seconds: 30,
|
||||
* })
|
||||
* //=> Thu Jun 15 2017 15:29:20
|
||||
*/
|
||||
export function add(date, duration) {
|
||||
const {
|
||||
years = 0,
|
||||
months = 0,
|
||||
weeks = 0,
|
||||
days = 0,
|
||||
hours = 0,
|
||||
minutes = 0,
|
||||
seconds = 0,
|
||||
} = duration;
|
||||
|
||||
// Add years and months
|
||||
const _date = toDate(date);
|
||||
const dateWithMonths =
|
||||
months || years ? addMonths(_date, months + years * 12) : _date;
|
||||
|
||||
// Add weeks and days
|
||||
const dateWithDays =
|
||||
days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
|
||||
|
||||
// Add days, hours, minutes and seconds
|
||||
const minutesToAdd = minutes + hours * 60;
|
||||
const secondsToAdd = seconds + minutesToAdd * 60;
|
||||
const msToAdd = secondsToAdd * 1000;
|
||||
const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);
|
||||
|
||||
return finalDate;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default add;
|
||||
24
frontend/node_modules/date-fns/addBusinessDays.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addBusinessDays.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addBusinessDays
|
||||
* @category Date Extension Helpers
|
||||
* @summary Add the specified number of business days (mon - fri) to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
|
||||
*
|
||||
* @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 be changed
|
||||
* @param amount - The amount of business days to be added.
|
||||
*
|
||||
* @returns The new date with the business days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 business days to 1 September 2014:
|
||||
* const result = addBusinessDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
|
||||
*/
|
||||
export declare function addBusinessDays<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addBusinessDays.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addBusinessDays.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addBusinessDays
|
||||
* @category Date Extension Helpers
|
||||
* @summary Add the specified number of business days (mon - fri) to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
|
||||
*
|
||||
* @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 be changed
|
||||
* @param amount - The amount of business days to be added.
|
||||
*
|
||||
* @returns The new date with the business days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 business days to 1 September 2014:
|
||||
* const result = addBusinessDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
|
||||
*/
|
||||
export declare function addBusinessDays<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
66
frontend/node_modules/date-fns/addBusinessDays.js
generated
vendored
Normal file
66
frontend/node_modules/date-fns/addBusinessDays.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
exports.addBusinessDays = addBusinessDays;
|
||||
var _index = require("./constructFrom.js");
|
||||
var _index2 = require("./isSaturday.js");
|
||||
var _index3 = require("./isSunday.js");
|
||||
var _index4 = require("./isWeekend.js");
|
||||
var _index5 = require("./toDate.js");
|
||||
|
||||
/**
|
||||
* @name addBusinessDays
|
||||
* @category Date Extension Helpers
|
||||
* @summary Add the specified number of business days (mon - fri) to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
|
||||
*
|
||||
* @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 be changed
|
||||
* @param amount - The amount of business days to be added.
|
||||
*
|
||||
* @returns The new date with the business days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 business days to 1 September 2014:
|
||||
* const result = addBusinessDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
|
||||
*/
|
||||
function addBusinessDays(date, amount) {
|
||||
const _date = (0, _index5.toDate)(date);
|
||||
const startedOnWeekend = (0, _index4.isWeekend)(_date);
|
||||
|
||||
if (isNaN(amount)) return (0, _index.constructFrom)(date, NaN);
|
||||
|
||||
const hours = _date.getHours();
|
||||
const sign = amount < 0 ? -1 : 1;
|
||||
const fullWeeks = Math.trunc(amount / 5);
|
||||
|
||||
_date.setDate(_date.getDate() + fullWeeks * 7);
|
||||
|
||||
// Get remaining days not part of a full week
|
||||
let restDays = Math.abs(amount % 5);
|
||||
|
||||
// Loops over remaining days
|
||||
while (restDays > 0) {
|
||||
_date.setDate(_date.getDate() + sign);
|
||||
if (!(0, _index4.isWeekend)(_date)) restDays -= 1;
|
||||
}
|
||||
|
||||
// If the date is a weekend day and we reduce a dividable of
|
||||
// 5 from it, we land on a weekend date.
|
||||
// To counter this, we add days accordingly to land on the next business day
|
||||
if (startedOnWeekend && (0, _index4.isWeekend)(_date) && amount !== 0) {
|
||||
// If we're reducing days, we want to add days until we land on a weekday
|
||||
// If we're adding days we want to reduce days until we land on a weekday
|
||||
if ((0, _index2.isSaturday)(_date))
|
||||
_date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
|
||||
if ((0, _index3.isSunday)(_date))
|
||||
_date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
|
||||
}
|
||||
|
||||
// Restore hours to avoid DST lag
|
||||
_date.setHours(hours);
|
||||
|
||||
return _date;
|
||||
}
|
||||
65
frontend/node_modules/date-fns/addBusinessDays.mjs
generated
vendored
Normal file
65
frontend/node_modules/date-fns/addBusinessDays.mjs
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
import { constructFrom } from "./constructFrom.mjs";
|
||||
import { isSaturday } from "./isSaturday.mjs";
|
||||
import { isSunday } from "./isSunday.mjs";
|
||||
import { isWeekend } from "./isWeekend.mjs";
|
||||
import { toDate } from "./toDate.mjs";
|
||||
|
||||
/**
|
||||
* @name addBusinessDays
|
||||
* @category Date Extension Helpers
|
||||
* @summary Add the specified number of business days (mon - fri) to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
|
||||
*
|
||||
* @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 be changed
|
||||
* @param amount - The amount of business days to be added.
|
||||
*
|
||||
* @returns The new date with the business days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 business days to 1 September 2014:
|
||||
* const result = addBusinessDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
|
||||
*/
|
||||
export function addBusinessDays(date, amount) {
|
||||
const _date = toDate(date);
|
||||
const startedOnWeekend = isWeekend(_date);
|
||||
|
||||
if (isNaN(amount)) return constructFrom(date, NaN);
|
||||
|
||||
const hours = _date.getHours();
|
||||
const sign = amount < 0 ? -1 : 1;
|
||||
const fullWeeks = Math.trunc(amount / 5);
|
||||
|
||||
_date.setDate(_date.getDate() + fullWeeks * 7);
|
||||
|
||||
// Get remaining days not part of a full week
|
||||
let restDays = Math.abs(amount % 5);
|
||||
|
||||
// Loops over remaining days
|
||||
while (restDays > 0) {
|
||||
_date.setDate(_date.getDate() + sign);
|
||||
if (!isWeekend(_date)) restDays -= 1;
|
||||
}
|
||||
|
||||
// If the date is a weekend day and we reduce a dividable of
|
||||
// 5 from it, we land on a weekend date.
|
||||
// To counter this, we add days accordingly to land on the next business day
|
||||
if (startedOnWeekend && isWeekend(_date) && amount !== 0) {
|
||||
// If we're reducing days, we want to add days until we land on a weekday
|
||||
// If we're adding days we want to reduce days until we land on a weekday
|
||||
if (isSaturday(_date)) _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
|
||||
if (isSunday(_date)) _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
|
||||
}
|
||||
|
||||
// Restore hours to avoid DST lag
|
||||
_date.setHours(hours);
|
||||
|
||||
return _date;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addBusinessDays;
|
||||
24
frontend/node_modules/date-fns/addDays.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addDays.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to 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 date to be changed
|
||||
* @param amount - The amount of days to be added.
|
||||
*
|
||||
* @returns The new date with the days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* const result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
export declare function addDays<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addDays.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addDays.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to 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 date to be changed
|
||||
* @param amount - The amount of days to be added.
|
||||
*
|
||||
* @returns The new date with the days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* const result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
export declare function addDays<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
35
frontend/node_modules/date-fns/addDays.js
generated
vendored
Normal file
35
frontend/node_modules/date-fns/addDays.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
exports.addDays = addDays;
|
||||
var _index = require("./toDate.js");
|
||||
var _index2 = require("./constructFrom.js");
|
||||
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to 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 date to be changed
|
||||
* @param amount - The amount of days to be added.
|
||||
*
|
||||
* @returns The new date with the days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* const result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
function addDays(date, amount) {
|
||||
const _date = (0, _index.toDate)(date);
|
||||
if (isNaN(amount)) return (0, _index2.constructFrom)(date, NaN);
|
||||
if (!amount) {
|
||||
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
||||
return _date;
|
||||
}
|
||||
_date.setDate(_date.getDate() + amount);
|
||||
return _date;
|
||||
}
|
||||
36
frontend/node_modules/date-fns/addDays.mjs
generated
vendored
Normal file
36
frontend/node_modules/date-fns/addDays.mjs
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
import { toDate } from "./toDate.mjs";
|
||||
import { constructFrom } from "./constructFrom.mjs";
|
||||
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to 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 date to be changed
|
||||
* @param amount - The amount of days to be added.
|
||||
*
|
||||
* @returns The new date with the days added
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* const result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
export function addDays(date, amount) {
|
||||
const _date = toDate(date);
|
||||
if (isNaN(amount)) return constructFrom(date, NaN);
|
||||
if (!amount) {
|
||||
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
||||
return _date;
|
||||
}
|
||||
_date.setDate(_date.getDate() + amount);
|
||||
return _date;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addDays;
|
||||
24
frontend/node_modules/date-fns/addHours.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addHours.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addHours
|
||||
* @category Hour Helpers
|
||||
* @summary Add the specified number of hours to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of hours to 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 date to be changed
|
||||
* @param amount - The amount of hours to be added.
|
||||
*
|
||||
* @returns The new date with the hours added
|
||||
*
|
||||
* @example
|
||||
* // Add 2 hours to 10 July 2014 23:00:00:
|
||||
* const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
|
||||
* //=> Fri Jul 11 2014 01:00:00
|
||||
*/
|
||||
export declare function addHours<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addHours.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addHours.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addHours
|
||||
* @category Hour Helpers
|
||||
* @summary Add the specified number of hours to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of hours to 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 date to be changed
|
||||
* @param amount - The amount of hours to be added.
|
||||
*
|
||||
* @returns The new date with the hours added
|
||||
*
|
||||
* @example
|
||||
* // Add 2 hours to 10 July 2014 23:00:00:
|
||||
* const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
|
||||
* //=> Fri Jul 11 2014 01:00:00
|
||||
*/
|
||||
export declare function addHours<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
28
frontend/node_modules/date-fns/addHours.js
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addHours.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
exports.addHours = addHours;
|
||||
var _index = require("./addMilliseconds.js");
|
||||
var _index2 = require("./constants.js");
|
||||
|
||||
/**
|
||||
* @name addHours
|
||||
* @category Hour Helpers
|
||||
* @summary Add the specified number of hours to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of hours to 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 date to be changed
|
||||
* @param amount - The amount of hours to be added.
|
||||
*
|
||||
* @returns The new date with the hours added
|
||||
*
|
||||
* @example
|
||||
* // Add 2 hours to 10 July 2014 23:00:00:
|
||||
* const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
|
||||
* //=> Fri Jul 11 2014 01:00:00
|
||||
*/
|
||||
function addHours(date, amount) {
|
||||
return (0, _index.addMilliseconds)(date, amount * _index2.millisecondsInHour);
|
||||
}
|
||||
29
frontend/node_modules/date-fns/addHours.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/addHours.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { addMilliseconds } from "./addMilliseconds.mjs";
|
||||
import { millisecondsInHour } from "./constants.mjs";
|
||||
|
||||
/**
|
||||
* @name addHours
|
||||
* @category Hour Helpers
|
||||
* @summary Add the specified number of hours to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of hours to 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 date to be changed
|
||||
* @param amount - The amount of hours to be added.
|
||||
*
|
||||
* @returns The new date with the hours added
|
||||
*
|
||||
* @example
|
||||
* // Add 2 hours to 10 July 2014 23:00:00:
|
||||
* const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
|
||||
* //=> Fri Jul 11 2014 01:00:00
|
||||
*/
|
||||
export function addHours(date, amount) {
|
||||
return addMilliseconds(date, amount * millisecondsInHour);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addHours;
|
||||
26
frontend/node_modules/date-fns/addISOWeekYears.d.mts
generated
vendored
Normal file
26
frontend/node_modules/date-fns/addISOWeekYears.d.mts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @name addISOWeekYears
|
||||
* @category ISO Week-Numbering Year Helpers
|
||||
* @summary Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* 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).
|
||||
*
|
||||
* @param date - The date to be changed
|
||||
* @param amount - The amount of ISO week-numbering years to be added.
|
||||
*
|
||||
* @returns The new date with the ISO week-numbering years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 ISO week-numbering years to 2 July 2010:
|
||||
* const result = addISOWeekYears(new Date(2010, 6, 2), 5)
|
||||
* //=> Fri Jn 26 2015 00:00:00
|
||||
*/
|
||||
export declare function addISOWeekYears<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
26
frontend/node_modules/date-fns/addISOWeekYears.d.ts
generated
vendored
Normal file
26
frontend/node_modules/date-fns/addISOWeekYears.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @name addISOWeekYears
|
||||
* @category ISO Week-Numbering Year Helpers
|
||||
* @summary Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* 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).
|
||||
*
|
||||
* @param date - The date to be changed
|
||||
* @param amount - The amount of ISO week-numbering years to be added.
|
||||
*
|
||||
* @returns The new date with the ISO week-numbering years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 ISO week-numbering years to 2 July 2010:
|
||||
* const result = addISOWeekYears(new Date(2010, 6, 2), 5)
|
||||
* //=> Fri Jn 26 2015 00:00:00
|
||||
*/
|
||||
export declare function addISOWeekYears<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
33
frontend/node_modules/date-fns/addISOWeekYears.js
generated
vendored
Normal file
33
frontend/node_modules/date-fns/addISOWeekYears.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
exports.addISOWeekYears = addISOWeekYears;
|
||||
var _index = require("./getISOWeekYear.js");
|
||||
var _index2 = require("./setISOWeekYear.js");
|
||||
|
||||
/**
|
||||
* @name addISOWeekYears
|
||||
* @category ISO Week-Numbering Year Helpers
|
||||
* @summary Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* 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).
|
||||
*
|
||||
* @param date - The date to be changed
|
||||
* @param amount - The amount of ISO week-numbering years to be added.
|
||||
*
|
||||
* @returns The new date with the ISO week-numbering years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 ISO week-numbering years to 2 July 2010:
|
||||
* const result = addISOWeekYears(new Date(2010, 6, 2), 5)
|
||||
* //=> Fri Jn 26 2015 00:00:00
|
||||
*/
|
||||
function addISOWeekYears(date, amount) {
|
||||
return (0, _index2.setISOWeekYear)(
|
||||
date,
|
||||
(0, _index.getISOWeekYear)(date) + amount,
|
||||
);
|
||||
}
|
||||
31
frontend/node_modules/date-fns/addISOWeekYears.mjs
generated
vendored
Normal file
31
frontend/node_modules/date-fns/addISOWeekYears.mjs
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
import { getISOWeekYear } from "./getISOWeekYear.mjs";
|
||||
import { setISOWeekYear } from "./setISOWeekYear.mjs";
|
||||
|
||||
/**
|
||||
* @name addISOWeekYears
|
||||
* @category ISO Week-Numbering Year Helpers
|
||||
* @summary Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of ISO week-numbering years to the given date.
|
||||
*
|
||||
* 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).
|
||||
*
|
||||
* @param date - The date to be changed
|
||||
* @param amount - The amount of ISO week-numbering years to be added.
|
||||
*
|
||||
* @returns The new date with the ISO week-numbering years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 ISO week-numbering years to 2 July 2010:
|
||||
* const result = addISOWeekYears(new Date(2010, 6, 2), 5)
|
||||
* //=> Fri Jn 26 2015 00:00:00
|
||||
*/
|
||||
export function addISOWeekYears(date, amount) {
|
||||
return setISOWeekYear(date, getISOWeekYear(date) + amount);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addISOWeekYears;
|
||||
24
frontend/node_modules/date-fns/addMilliseconds.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addMilliseconds.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addMilliseconds
|
||||
* @category Millisecond Helpers
|
||||
* @summary Add the specified number of milliseconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of milliseconds to 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 date to be changed
|
||||
* @param amount - The amount of milliseconds to be added.
|
||||
*
|
||||
* @returns The new date with the milliseconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
||||
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
||||
* //=> Thu Jul 10 2014 12:45:30.750
|
||||
*/
|
||||
export declare function addMilliseconds<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addMilliseconds.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addMilliseconds.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addMilliseconds
|
||||
* @category Millisecond Helpers
|
||||
* @summary Add the specified number of milliseconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of milliseconds to 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 date to be changed
|
||||
* @param amount - The amount of milliseconds to be added.
|
||||
*
|
||||
* @returns The new date with the milliseconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
||||
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
||||
* //=> Thu Jul 10 2014 12:45:30.750
|
||||
*/
|
||||
export declare function addMilliseconds<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
29
frontend/node_modules/date-fns/addMilliseconds.js
generated
vendored
Normal file
29
frontend/node_modules/date-fns/addMilliseconds.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
exports.addMilliseconds = addMilliseconds;
|
||||
var _index = require("./toDate.js");
|
||||
var _index2 = require("./constructFrom.js");
|
||||
|
||||
/**
|
||||
* @name addMilliseconds
|
||||
* @category Millisecond Helpers
|
||||
* @summary Add the specified number of milliseconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of milliseconds to 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 date to be changed
|
||||
* @param amount - The amount of milliseconds to be added.
|
||||
*
|
||||
* @returns The new date with the milliseconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
||||
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
||||
* //=> Thu Jul 10 2014 12:45:30.750
|
||||
*/
|
||||
function addMilliseconds(date, amount) {
|
||||
const timestamp = +(0, _index.toDate)(date);
|
||||
return (0, _index2.constructFrom)(date, timestamp + amount);
|
||||
}
|
||||
30
frontend/node_modules/date-fns/addMilliseconds.mjs
generated
vendored
Normal file
30
frontend/node_modules/date-fns/addMilliseconds.mjs
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { toDate } from "./toDate.mjs";
|
||||
import { constructFrom } from "./constructFrom.mjs";
|
||||
|
||||
/**
|
||||
* @name addMilliseconds
|
||||
* @category Millisecond Helpers
|
||||
* @summary Add the specified number of milliseconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of milliseconds to 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 date to be changed
|
||||
* @param amount - The amount of milliseconds to be added.
|
||||
*
|
||||
* @returns The new date with the milliseconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
||||
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
||||
* //=> Thu Jul 10 2014 12:45:30.750
|
||||
*/
|
||||
export function addMilliseconds(date, amount) {
|
||||
const timestamp = +toDate(date);
|
||||
return constructFrom(date, timestamp + amount);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addMilliseconds;
|
||||
24
frontend/node_modules/date-fns/addMinutes.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addMinutes.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addMinutes
|
||||
* @category Minute Helpers
|
||||
* @summary Add the specified number of minutes to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of minutes to 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 date to be changed
|
||||
* @param amount - The amount of minutes to be added.
|
||||
*
|
||||
* @returns The new date with the minutes added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 minutes to 10 July 2014 12:00:00:
|
||||
* const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:30:00
|
||||
*/
|
||||
export declare function addMinutes<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addMinutes.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addMinutes.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addMinutes
|
||||
* @category Minute Helpers
|
||||
* @summary Add the specified number of minutes to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of minutes to 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 date to be changed
|
||||
* @param amount - The amount of minutes to be added.
|
||||
*
|
||||
* @returns The new date with the minutes added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 minutes to 10 July 2014 12:00:00:
|
||||
* const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:30:00
|
||||
*/
|
||||
export declare function addMinutes<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
31
frontend/node_modules/date-fns/addMinutes.js
generated
vendored
Normal file
31
frontend/node_modules/date-fns/addMinutes.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
exports.addMinutes = addMinutes;
|
||||
var _index = require("./addMilliseconds.js");
|
||||
var _index2 = require("./constants.js");
|
||||
|
||||
/**
|
||||
* @name addMinutes
|
||||
* @category Minute Helpers
|
||||
* @summary Add the specified number of minutes to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of minutes to 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 date to be changed
|
||||
* @param amount - The amount of minutes to be added.
|
||||
*
|
||||
* @returns The new date with the minutes added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 minutes to 10 July 2014 12:00:00:
|
||||
* const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:30:00
|
||||
*/
|
||||
function addMinutes(date, amount) {
|
||||
return (0, _index.addMilliseconds)(
|
||||
date,
|
||||
amount * _index2.millisecondsInMinute,
|
||||
);
|
||||
}
|
||||
29
frontend/node_modules/date-fns/addMinutes.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/addMinutes.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { addMilliseconds } from "./addMilliseconds.mjs";
|
||||
import { millisecondsInMinute } from "./constants.mjs";
|
||||
|
||||
/**
|
||||
* @name addMinutes
|
||||
* @category Minute Helpers
|
||||
* @summary Add the specified number of minutes to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of minutes to 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 date to be changed
|
||||
* @param amount - The amount of minutes to be added.
|
||||
*
|
||||
* @returns The new date with the minutes added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 minutes to 10 July 2014 12:00:00:
|
||||
* const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:30:00
|
||||
*/
|
||||
export function addMinutes(date, amount) {
|
||||
return addMilliseconds(date, amount * millisecondsInMinute);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addMinutes;
|
||||
28
frontend/node_modules/date-fns/addMonths.d.mts
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addMonths.d.mts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @name addMonths
|
||||
* @category Month Helpers
|
||||
* @summary Add the specified number of months to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of months to 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 date to be changed
|
||||
* @param amount - The amount of months to be added.
|
||||
*
|
||||
* @returns The new date with the months added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 months to 1 September 2014:
|
||||
* const result = addMonths(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Feb 01 2015 00:00:00
|
||||
*
|
||||
* // Add one month to 30 January 2023:
|
||||
* const result = addMonths(new Date(2023, 0, 30), 1)
|
||||
* //=> Tue Feb 28 2023 00:00:00
|
||||
*/
|
||||
export declare function addMonths<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
28
frontend/node_modules/date-fns/addMonths.d.ts
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addMonths.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @name addMonths
|
||||
* @category Month Helpers
|
||||
* @summary Add the specified number of months to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of months to 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 date to be changed
|
||||
* @param amount - The amount of months to be added.
|
||||
*
|
||||
* @returns The new date with the months added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 months to 1 September 2014:
|
||||
* const result = addMonths(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Feb 01 2015 00:00:00
|
||||
*
|
||||
* // Add one month to 30 January 2023:
|
||||
* const result = addMonths(new Date(2023, 0, 30), 1)
|
||||
* //=> Tue Feb 28 2023 00:00:00
|
||||
*/
|
||||
export declare function addMonths<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
69
frontend/node_modules/date-fns/addMonths.js
generated
vendored
Normal file
69
frontend/node_modules/date-fns/addMonths.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
exports.addMonths = addMonths;
|
||||
var _index = require("./toDate.js");
|
||||
var _index2 = require("./constructFrom.js");
|
||||
|
||||
/**
|
||||
* @name addMonths
|
||||
* @category Month Helpers
|
||||
* @summary Add the specified number of months to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of months to 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 date to be changed
|
||||
* @param amount - The amount of months to be added.
|
||||
*
|
||||
* @returns The new date with the months added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 months to 1 September 2014:
|
||||
* const result = addMonths(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Feb 01 2015 00:00:00
|
||||
*
|
||||
* // Add one month to 30 January 2023:
|
||||
* const result = addMonths(new Date(2023, 0, 30), 1)
|
||||
* //=> Tue Feb 28 2023 00:00:00
|
||||
*/
|
||||
function addMonths(date, amount) {
|
||||
const _date = (0, _index.toDate)(date);
|
||||
if (isNaN(amount)) return (0, _index2.constructFrom)(date, NaN);
|
||||
if (!amount) {
|
||||
// If 0 months, no-op to avoid changing times in the hour before end of DST
|
||||
return _date;
|
||||
}
|
||||
const dayOfMonth = _date.getDate();
|
||||
|
||||
// The JS Date object supports date math by accepting out-of-bounds values for
|
||||
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
|
||||
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
|
||||
// want except that dates will wrap around the end of a month, meaning that
|
||||
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
|
||||
// we'll default to the end of the desired month by adding 1 to the desired
|
||||
// month and using a date of 0 to back up one day to the end of the desired
|
||||
// month.
|
||||
const endOfDesiredMonth = (0, _index2.constructFrom)(date, _date.getTime());
|
||||
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
|
||||
const daysInMonth = endOfDesiredMonth.getDate();
|
||||
if (dayOfMonth >= daysInMonth) {
|
||||
// If we're already at the end of the month, then this is the correct date
|
||||
// and we're done.
|
||||
return endOfDesiredMonth;
|
||||
} else {
|
||||
// Otherwise, we now know that setting the original day-of-month value won't
|
||||
// cause an overflow, so set the desired day-of-month. Note that we can't
|
||||
// just set the date of `endOfDesiredMonth` because that object may have had
|
||||
// its time changed in the unusual case where where a DST transition was on
|
||||
// the last day of the month and its local time was in the hour skipped or
|
||||
// repeated next to a DST transition. So we use `date` instead which is
|
||||
// guaranteed to still have the original time.
|
||||
_date.setFullYear(
|
||||
endOfDesiredMonth.getFullYear(),
|
||||
endOfDesiredMonth.getMonth(),
|
||||
dayOfMonth,
|
||||
);
|
||||
return _date;
|
||||
}
|
||||
}
|
||||
70
frontend/node_modules/date-fns/addMonths.mjs
generated
vendored
Normal file
70
frontend/node_modules/date-fns/addMonths.mjs
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
import { toDate } from "./toDate.mjs";
|
||||
import { constructFrom } from "./constructFrom.mjs";
|
||||
|
||||
/**
|
||||
* @name addMonths
|
||||
* @category Month Helpers
|
||||
* @summary Add the specified number of months to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of months to 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 date to be changed
|
||||
* @param amount - The amount of months to be added.
|
||||
*
|
||||
* @returns The new date with the months added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 months to 1 September 2014:
|
||||
* const result = addMonths(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Feb 01 2015 00:00:00
|
||||
*
|
||||
* // Add one month to 30 January 2023:
|
||||
* const result = addMonths(new Date(2023, 0, 30), 1)
|
||||
* //=> Tue Feb 28 2023 00:00:00
|
||||
*/
|
||||
export function addMonths(date, amount) {
|
||||
const _date = toDate(date);
|
||||
if (isNaN(amount)) return constructFrom(date, NaN);
|
||||
if (!amount) {
|
||||
// If 0 months, no-op to avoid changing times in the hour before end of DST
|
||||
return _date;
|
||||
}
|
||||
const dayOfMonth = _date.getDate();
|
||||
|
||||
// The JS Date object supports date math by accepting out-of-bounds values for
|
||||
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
|
||||
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
|
||||
// want except that dates will wrap around the end of a month, meaning that
|
||||
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
|
||||
// we'll default to the end of the desired month by adding 1 to the desired
|
||||
// month and using a date of 0 to back up one day to the end of the desired
|
||||
// month.
|
||||
const endOfDesiredMonth = constructFrom(date, _date.getTime());
|
||||
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
|
||||
const daysInMonth = endOfDesiredMonth.getDate();
|
||||
if (dayOfMonth >= daysInMonth) {
|
||||
// If we're already at the end of the month, then this is the correct date
|
||||
// and we're done.
|
||||
return endOfDesiredMonth;
|
||||
} else {
|
||||
// Otherwise, we now know that setting the original day-of-month value won't
|
||||
// cause an overflow, so set the desired day-of-month. Note that we can't
|
||||
// just set the date of `endOfDesiredMonth` because that object may have had
|
||||
// its time changed in the unusual case where where a DST transition was on
|
||||
// the last day of the month and its local time was in the hour skipped or
|
||||
// repeated next to a DST transition. So we use `date` instead which is
|
||||
// guaranteed to still have the original time.
|
||||
_date.setFullYear(
|
||||
endOfDesiredMonth.getFullYear(),
|
||||
endOfDesiredMonth.getMonth(),
|
||||
dayOfMonth,
|
||||
);
|
||||
return _date;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addMonths;
|
||||
24
frontend/node_modules/date-fns/addQuarters.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addQuarters.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addQuarters
|
||||
* @category Quarter Helpers
|
||||
* @summary Add the specified number of year quarters to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of year quarters to 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 date to be changed
|
||||
* @param amount - The amount of quarters to be added.
|
||||
*
|
||||
* @returns The new date with the quarters added
|
||||
*
|
||||
* @example
|
||||
* // Add 1 quarter to 1 September 2014:
|
||||
* const result = addQuarters(new Date(2014, 8, 1), 1)
|
||||
* //=> Mon Dec 01 2014 00:00:00
|
||||
*/
|
||||
export declare function addQuarters<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addQuarters.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addQuarters.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addQuarters
|
||||
* @category Quarter Helpers
|
||||
* @summary Add the specified number of year quarters to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of year quarters to 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 date to be changed
|
||||
* @param amount - The amount of quarters to be added.
|
||||
*
|
||||
* @returns The new date with the quarters added
|
||||
*
|
||||
* @example
|
||||
* // Add 1 quarter to 1 September 2014:
|
||||
* const result = addQuarters(new Date(2014, 8, 1), 1)
|
||||
* //=> Mon Dec 01 2014 00:00:00
|
||||
*/
|
||||
export declare function addQuarters<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
28
frontend/node_modules/date-fns/addQuarters.js
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addQuarters.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
exports.addQuarters = addQuarters;
|
||||
var _index = require("./addMonths.js");
|
||||
|
||||
/**
|
||||
* @name addQuarters
|
||||
* @category Quarter Helpers
|
||||
* @summary Add the specified number of year quarters to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of year quarters to 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 date to be changed
|
||||
* @param amount - The amount of quarters to be added.
|
||||
*
|
||||
* @returns The new date with the quarters added
|
||||
*
|
||||
* @example
|
||||
* // Add 1 quarter to 1 September 2014:
|
||||
* const result = addQuarters(new Date(2014, 8, 1), 1)
|
||||
* //=> Mon Dec 01 2014 00:00:00
|
||||
*/
|
||||
function addQuarters(date, amount) {
|
||||
const months = amount * 3;
|
||||
return (0, _index.addMonths)(date, months);
|
||||
}
|
||||
29
frontend/node_modules/date-fns/addQuarters.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/addQuarters.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { addMonths } from "./addMonths.mjs";
|
||||
|
||||
/**
|
||||
* @name addQuarters
|
||||
* @category Quarter Helpers
|
||||
* @summary Add the specified number of year quarters to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of year quarters to 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 date to be changed
|
||||
* @param amount - The amount of quarters to be added.
|
||||
*
|
||||
* @returns The new date with the quarters added
|
||||
*
|
||||
* @example
|
||||
* // Add 1 quarter to 1 September 2014:
|
||||
* const result = addQuarters(new Date(2014, 8, 1), 1)
|
||||
* //=> Mon Dec 01 2014 00:00:00
|
||||
*/
|
||||
export function addQuarters(date, amount) {
|
||||
const months = amount * 3;
|
||||
return addMonths(date, months);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addQuarters;
|
||||
24
frontend/node_modules/date-fns/addSeconds.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addSeconds.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addSeconds
|
||||
* @category Second Helpers
|
||||
* @summary Add the specified number of seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of seconds to 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 date to be changed
|
||||
* @param amount - The amount of seconds to be added.
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 seconds to 10 July 2014 12:45:00:
|
||||
* const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:45:30
|
||||
*/
|
||||
export declare function addSeconds<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addSeconds.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addSeconds.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addSeconds
|
||||
* @category Second Helpers
|
||||
* @summary Add the specified number of seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of seconds to 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 date to be changed
|
||||
* @param amount - The amount of seconds to be added.
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 seconds to 10 July 2014 12:45:00:
|
||||
* const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:45:30
|
||||
*/
|
||||
export declare function addSeconds<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
27
frontend/node_modules/date-fns/addSeconds.js
generated
vendored
Normal file
27
frontend/node_modules/date-fns/addSeconds.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
exports.addSeconds = addSeconds;
|
||||
var _index = require("./addMilliseconds.js");
|
||||
|
||||
/**
|
||||
* @name addSeconds
|
||||
* @category Second Helpers
|
||||
* @summary Add the specified number of seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of seconds to 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 date to be changed
|
||||
* @param amount - The amount of seconds to be added.
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 seconds to 10 July 2014 12:45:00:
|
||||
* const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:45:30
|
||||
*/
|
||||
function addSeconds(date, amount) {
|
||||
return (0, _index.addMilliseconds)(date, amount * 1000);
|
||||
}
|
||||
28
frontend/node_modules/date-fns/addSeconds.mjs
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addSeconds.mjs
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
import { addMilliseconds } from "./addMilliseconds.mjs";
|
||||
|
||||
/**
|
||||
* @name addSeconds
|
||||
* @category Second Helpers
|
||||
* @summary Add the specified number of seconds to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of seconds to 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 date to be changed
|
||||
* @param amount - The amount of seconds to be added.
|
||||
*
|
||||
* @returns The new date with the seconds added
|
||||
*
|
||||
* @example
|
||||
* // Add 30 seconds to 10 July 2014 12:45:00:
|
||||
* const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
|
||||
* //=> Thu Jul 10 2014 12:45:30
|
||||
*/
|
||||
export function addSeconds(date, amount) {
|
||||
return addMilliseconds(date, amount * 1000);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addSeconds;
|
||||
24
frontend/node_modules/date-fns/addWeeks.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addWeeks.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addWeeks
|
||||
* @category Week Helpers
|
||||
* @summary Add the specified number of weeks to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of week to 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 date to be changed
|
||||
* @param amount - The amount of weeks to be added.
|
||||
*
|
||||
* @returns The new date with the weeks added
|
||||
*
|
||||
* @example
|
||||
* // Add 4 weeks to 1 September 2014:
|
||||
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
||||
* //=> Mon Sep 29 2014 00:00:00
|
||||
*/
|
||||
export declare function addWeeks<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addWeeks.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addWeeks.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addWeeks
|
||||
* @category Week Helpers
|
||||
* @summary Add the specified number of weeks to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of week to 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 date to be changed
|
||||
* @param amount - The amount of weeks to be added.
|
||||
*
|
||||
* @returns The new date with the weeks added
|
||||
*
|
||||
* @example
|
||||
* // Add 4 weeks to 1 September 2014:
|
||||
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
||||
* //=> Mon Sep 29 2014 00:00:00
|
||||
*/
|
||||
export declare function addWeeks<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
28
frontend/node_modules/date-fns/addWeeks.js
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addWeeks.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
exports.addWeeks = addWeeks;
|
||||
var _index = require("./addDays.js");
|
||||
|
||||
/**
|
||||
* @name addWeeks
|
||||
* @category Week Helpers
|
||||
* @summary Add the specified number of weeks to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of week to 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 date to be changed
|
||||
* @param amount - The amount of weeks to be added.
|
||||
*
|
||||
* @returns The new date with the weeks added
|
||||
*
|
||||
* @example
|
||||
* // Add 4 weeks to 1 September 2014:
|
||||
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
||||
* //=> Mon Sep 29 2014 00:00:00
|
||||
*/
|
||||
function addWeeks(date, amount) {
|
||||
const days = amount * 7;
|
||||
return (0, _index.addDays)(date, days);
|
||||
}
|
||||
29
frontend/node_modules/date-fns/addWeeks.mjs
generated
vendored
Normal file
29
frontend/node_modules/date-fns/addWeeks.mjs
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { addDays } from "./addDays.mjs";
|
||||
|
||||
/**
|
||||
* @name addWeeks
|
||||
* @category Week Helpers
|
||||
* @summary Add the specified number of weeks to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of week to 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 date to be changed
|
||||
* @param amount - The amount of weeks to be added.
|
||||
*
|
||||
* @returns The new date with the weeks added
|
||||
*
|
||||
* @example
|
||||
* // Add 4 weeks to 1 September 2014:
|
||||
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
||||
* //=> Mon Sep 29 2014 00:00:00
|
||||
*/
|
||||
export function addWeeks(date, amount) {
|
||||
const days = amount * 7;
|
||||
return addDays(date, days);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addWeeks;
|
||||
24
frontend/node_modules/date-fns/addYears.d.mts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addYears.d.mts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addYears
|
||||
* @category Year Helpers
|
||||
* @summary Add the specified number of years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of years to 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 date to be changed
|
||||
* @param amount - The amount of years to be added.
|
||||
*
|
||||
* @returns The new date with the years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 years to 1 September 2014:
|
||||
* const result = addYears(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Sep 01 2019 00:00:00
|
||||
*/
|
||||
export declare function addYears<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
24
frontend/node_modules/date-fns/addYears.d.ts
generated
vendored
Normal file
24
frontend/node_modules/date-fns/addYears.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name addYears
|
||||
* @category Year Helpers
|
||||
* @summary Add the specified number of years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of years to 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 date to be changed
|
||||
* @param amount - The amount of years to be added.
|
||||
*
|
||||
* @returns The new date with the years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 years to 1 September 2014:
|
||||
* const result = addYears(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Sep 01 2019 00:00:00
|
||||
*/
|
||||
export declare function addYears<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
amount: number,
|
||||
): DateType;
|
||||
27
frontend/node_modules/date-fns/addYears.js
generated
vendored
Normal file
27
frontend/node_modules/date-fns/addYears.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
exports.addYears = addYears;
|
||||
var _index = require("./addMonths.js");
|
||||
|
||||
/**
|
||||
* @name addYears
|
||||
* @category Year Helpers
|
||||
* @summary Add the specified number of years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of years to 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 date to be changed
|
||||
* @param amount - The amount of years to be added.
|
||||
*
|
||||
* @returns The new date with the years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 years to 1 September 2014:
|
||||
* const result = addYears(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Sep 01 2019 00:00:00
|
||||
*/
|
||||
function addYears(date, amount) {
|
||||
return (0, _index.addMonths)(date, amount * 12);
|
||||
}
|
||||
28
frontend/node_modules/date-fns/addYears.mjs
generated
vendored
Normal file
28
frontend/node_modules/date-fns/addYears.mjs
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
import { addMonths } from "./addMonths.mjs";
|
||||
|
||||
/**
|
||||
* @name addYears
|
||||
* @category Year Helpers
|
||||
* @summary Add the specified number of years to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of years to 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 date to be changed
|
||||
* @param amount - The amount of years to be added.
|
||||
*
|
||||
* @returns The new date with the years added
|
||||
*
|
||||
* @example
|
||||
* // Add 5 years to 1 September 2014:
|
||||
* const result = addYears(new Date(2014, 8, 1), 5)
|
||||
* //=> Sun Sep 01 2019 00:00:00
|
||||
*/
|
||||
export function addYears(date, amount) {
|
||||
return addMonths(date, amount * 12);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default addYears;
|
||||
67
frontend/node_modules/date-fns/areIntervalsOverlapping.d.mts
generated
vendored
Normal file
67
frontend/node_modules/date-fns/areIntervalsOverlapping.d.mts
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
import type { Interval } from "./types.js";
|
||||
/**
|
||||
* The {@link areIntervalsOverlapping} function options.
|
||||
*/
|
||||
export interface AreIntervalsOverlappingOptions {
|
||||
/** Whether the comparison is inclusive or not */
|
||||
inclusive?: boolean;
|
||||
}
|
||||
/**
|
||||
* @name areIntervalsOverlapping
|
||||
* @category Interval Helpers
|
||||
* @summary Is the given time interval overlapping with another time interval?
|
||||
*
|
||||
* @description
|
||||
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
|
||||
*
|
||||
* @param intervalLeft - The first interval to compare.
|
||||
* @param intervalRight - The second interval to compare.
|
||||
* @param options - The object with options
|
||||
*
|
||||
* @returns Whether the time intervals are overlapping
|
||||
*
|
||||
* @example
|
||||
* // For overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
||||
* )
|
||||
* //=> true
|
||||
*
|
||||
* @example
|
||||
* // For non-overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // For adjacent time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // Using the inclusive option:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
|
||||
* { inclusive: true }
|
||||
* )
|
||||
* //=> true
|
||||
*/
|
||||
export declare function areIntervalsOverlapping(
|
||||
intervalLeft: Interval,
|
||||
intervalRight: Interval,
|
||||
options?: AreIntervalsOverlappingOptions,
|
||||
): boolean;
|
||||
67
frontend/node_modules/date-fns/areIntervalsOverlapping.d.ts
generated
vendored
Normal file
67
frontend/node_modules/date-fns/areIntervalsOverlapping.d.ts
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
import type { Interval } from "./types.js";
|
||||
/**
|
||||
* The {@link areIntervalsOverlapping} function options.
|
||||
*/
|
||||
export interface AreIntervalsOverlappingOptions {
|
||||
/** Whether the comparison is inclusive or not */
|
||||
inclusive?: boolean;
|
||||
}
|
||||
/**
|
||||
* @name areIntervalsOverlapping
|
||||
* @category Interval Helpers
|
||||
* @summary Is the given time interval overlapping with another time interval?
|
||||
*
|
||||
* @description
|
||||
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
|
||||
*
|
||||
* @param intervalLeft - The first interval to compare.
|
||||
* @param intervalRight - The second interval to compare.
|
||||
* @param options - The object with options
|
||||
*
|
||||
* @returns Whether the time intervals are overlapping
|
||||
*
|
||||
* @example
|
||||
* // For overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
||||
* )
|
||||
* //=> true
|
||||
*
|
||||
* @example
|
||||
* // For non-overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // For adjacent time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // Using the inclusive option:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
|
||||
* { inclusive: true }
|
||||
* )
|
||||
* //=> true
|
||||
*/
|
||||
export declare function areIntervalsOverlapping(
|
||||
intervalLeft: Interval,
|
||||
intervalRight: Interval,
|
||||
options?: AreIntervalsOverlappingOptions,
|
||||
): boolean;
|
||||
77
frontend/node_modules/date-fns/areIntervalsOverlapping.js
generated
vendored
Normal file
77
frontend/node_modules/date-fns/areIntervalsOverlapping.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
exports.areIntervalsOverlapping = areIntervalsOverlapping;
|
||||
var _index = require("./toDate.js");
|
||||
|
||||
/**
|
||||
* The {@link areIntervalsOverlapping} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name areIntervalsOverlapping
|
||||
* @category Interval Helpers
|
||||
* @summary Is the given time interval overlapping with another time interval?
|
||||
*
|
||||
* @description
|
||||
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
|
||||
*
|
||||
* @param intervalLeft - The first interval to compare.
|
||||
* @param intervalRight - The second interval to compare.
|
||||
* @param options - The object with options
|
||||
*
|
||||
* @returns Whether the time intervals are overlapping
|
||||
*
|
||||
* @example
|
||||
* // For overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
||||
* )
|
||||
* //=> true
|
||||
*
|
||||
* @example
|
||||
* // For non-overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // For adjacent time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // Using the inclusive option:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
|
||||
* { inclusive: true }
|
||||
* )
|
||||
* //=> true
|
||||
*/
|
||||
function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
|
||||
const [leftStartTime, leftEndTime] = [
|
||||
+(0, _index.toDate)(intervalLeft.start),
|
||||
+(0, _index.toDate)(intervalLeft.end),
|
||||
].sort((a, b) => a - b);
|
||||
const [rightStartTime, rightEndTime] = [
|
||||
+(0, _index.toDate)(intervalRight.start),
|
||||
+(0, _index.toDate)(intervalRight.end),
|
||||
].sort((a, b) => a - b);
|
||||
|
||||
if (options?.inclusive)
|
||||
return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
|
||||
|
||||
return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
|
||||
}
|
||||
78
frontend/node_modules/date-fns/areIntervalsOverlapping.mjs
generated
vendored
Normal file
78
frontend/node_modules/date-fns/areIntervalsOverlapping.mjs
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
import { toDate } from "./toDate.mjs";
|
||||
|
||||
/**
|
||||
* The {@link areIntervalsOverlapping} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name areIntervalsOverlapping
|
||||
* @category Interval Helpers
|
||||
* @summary Is the given time interval overlapping with another time interval?
|
||||
*
|
||||
* @description
|
||||
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
|
||||
*
|
||||
* @param intervalLeft - The first interval to compare.
|
||||
* @param intervalRight - The second interval to compare.
|
||||
* @param options - The object with options
|
||||
*
|
||||
* @returns Whether the time intervals are overlapping
|
||||
*
|
||||
* @example
|
||||
* // For overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
||||
* )
|
||||
* //=> true
|
||||
*
|
||||
* @example
|
||||
* // For non-overlapping time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // For adjacent time intervals:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* // Using the inclusive option:
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
|
||||
* )
|
||||
* //=> false
|
||||
*
|
||||
* @example
|
||||
* areIntervalsOverlapping(
|
||||
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
||||
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
|
||||
* { inclusive: true }
|
||||
* )
|
||||
* //=> true
|
||||
*/
|
||||
export function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
|
||||
const [leftStartTime, leftEndTime] = [
|
||||
+toDate(intervalLeft.start),
|
||||
+toDate(intervalLeft.end),
|
||||
].sort((a, b) => a - b);
|
||||
const [rightStartTime, rightEndTime] = [
|
||||
+toDate(intervalRight.start),
|
||||
+toDate(intervalRight.end),
|
||||
].sort((a, b) => a - b);
|
||||
|
||||
if (options?.inclusive)
|
||||
return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
|
||||
|
||||
return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default areIntervalsOverlapping;
|
||||
6598
frontend/node_modules/date-fns/cdn.js
generated
vendored
Normal file
6598
frontend/node_modules/date-fns/cdn.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
frontend/node_modules/date-fns/cdn.js.map
generated
vendored
Normal file
1
frontend/node_modules/date-fns/cdn.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
frontend/node_modules/date-fns/cdn.min.js
generated
vendored
Normal file
3
frontend/node_modules/date-fns/cdn.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
frontend/node_modules/date-fns/cdn.min.js.map
generated
vendored
Normal file
10
frontend/node_modules/date-fns/cdn.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user