Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
98d0f61
1
Parent(s):
2be6f98
f937f2c0fda8ca78b76eb48473924da01edee5b36c9f095827df8cc566b4320c
Browse files- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers.d.mts +2 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers.d.ts +2 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.d.mts +15 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.d.ts +15 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +55 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs +45 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.d.mts +23 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.d.ts +23 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +85 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs +74 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +36 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +94 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs +84 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +85 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs +81 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +36 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.d.mts +20 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.d.ts +20 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +102 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs +95 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +94 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs +84 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.d.mts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.d.ts +14 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +85 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs +81 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.d.mts +12 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.d.ts +12 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +21 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs +17 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.d.mts +12 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.d.ts +12 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +24 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs +17 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.d.mts +25 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.d.ts +25 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.js +70 -0
- workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs +60 -0
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers.d.mts
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import type { Parser } from "./Parser.js";
|
2 |
+
export declare const parsers: Record<string, Parser<any>>;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers.d.ts
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import type { Parser } from "./Parser.js";
|
2 |
+
export declare const parsers: Record<string, Parser<any>>;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.d.mts
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
export declare class LocalWeekParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
options: ParserOptions,
|
13 |
+
): DateType;
|
14 |
+
incompatibleTokens: string[];
|
15 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
export declare class LocalWeekParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
options: ParserOptions,
|
13 |
+
): DateType;
|
14 |
+
incompatibleTokens: string[];
|
15 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.LocalWeekParser = void 0;
|
3 |
+
var _index = require("../../../setWeek.js");
|
4 |
+
var _index2 = require("../../../startOfWeek.js");
|
5 |
+
var _constants = require("../constants.js");
|
6 |
+
var _Parser = require("../Parser.js");
|
7 |
+
|
8 |
+
var _utils = require("../utils.js");
|
9 |
+
|
10 |
+
// Local week of year
|
11 |
+
class LocalWeekParser extends _Parser.Parser {
|
12 |
+
priority = 100;
|
13 |
+
|
14 |
+
parse(dateString, token, match) {
|
15 |
+
switch (token) {
|
16 |
+
case "w":
|
17 |
+
return (0, _utils.parseNumericPattern)(
|
18 |
+
_constants.numericPatterns.week,
|
19 |
+
dateString,
|
20 |
+
);
|
21 |
+
case "wo":
|
22 |
+
return match.ordinalNumber(dateString, { unit: "week" });
|
23 |
+
default:
|
24 |
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
validate(_date, value) {
|
29 |
+
return value >= 1 && value <= 53;
|
30 |
+
}
|
31 |
+
|
32 |
+
set(date, _flags, value, options) {
|
33 |
+
return (0, _index2.startOfWeek)(
|
34 |
+
(0, _index.setWeek)(date, value, options),
|
35 |
+
options,
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
incompatibleTokens = [
|
40 |
+
"y",
|
41 |
+
"R",
|
42 |
+
"u",
|
43 |
+
"q",
|
44 |
+
"Q",
|
45 |
+
"M",
|
46 |
+
"L",
|
47 |
+
"I",
|
48 |
+
"d",
|
49 |
+
"D",
|
50 |
+
"i",
|
51 |
+
"t",
|
52 |
+
"T",
|
53 |
+
];
|
54 |
+
}
|
55 |
+
exports.LocalWeekParser = LocalWeekParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { setWeek } from "../../../setWeek.mjs";
|
2 |
+
import { startOfWeek } from "../../../startOfWeek.mjs";
|
3 |
+
import { numericPatterns } from "../constants.mjs";
|
4 |
+
import { Parser } from "../Parser.mjs";
|
5 |
+
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
|
6 |
+
|
7 |
+
// Local week of year
|
8 |
+
export class LocalWeekParser extends Parser {
|
9 |
+
priority = 100;
|
10 |
+
|
11 |
+
parse(dateString, token, match) {
|
12 |
+
switch (token) {
|
13 |
+
case "w":
|
14 |
+
return parseNumericPattern(numericPatterns.week, dateString);
|
15 |
+
case "wo":
|
16 |
+
return match.ordinalNumber(dateString, { unit: "week" });
|
17 |
+
default:
|
18 |
+
return parseNDigits(token.length, dateString);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
validate(_date, value) {
|
23 |
+
return value >= 1 && value <= 53;
|
24 |
+
}
|
25 |
+
|
26 |
+
set(date, _flags, value, options) {
|
27 |
+
return startOfWeek(setWeek(date, value, options), options);
|
28 |
+
}
|
29 |
+
|
30 |
+
incompatibleTokens = [
|
31 |
+
"y",
|
32 |
+
"R",
|
33 |
+
"u",
|
34 |
+
"q",
|
35 |
+
"Q",
|
36 |
+
"M",
|
37 |
+
"L",
|
38 |
+
"I",
|
39 |
+
"d",
|
40 |
+
"D",
|
41 |
+
"i",
|
42 |
+
"t",
|
43 |
+
"T",
|
44 |
+
];
|
45 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.d.mts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
import type { YearParserValue } from "./YearParser.js";
|
5 |
+
export declare class LocalWeekYearParser extends Parser<YearParserValue> {
|
6 |
+
priority: number;
|
7 |
+
parse(
|
8 |
+
dateString: string,
|
9 |
+
token: string,
|
10 |
+
match: Match,
|
11 |
+
): ParseResult<YearParserValue>;
|
12 |
+
validate<DateType extends Date>(
|
13 |
+
_date: DateType,
|
14 |
+
value: YearParserValue,
|
15 |
+
): boolean;
|
16 |
+
set<DateType extends Date>(
|
17 |
+
date: DateType,
|
18 |
+
flags: ParseFlags,
|
19 |
+
value: YearParserValue,
|
20 |
+
options: ParserOptions,
|
21 |
+
): DateType;
|
22 |
+
incompatibleTokens: string[];
|
23 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
import type { YearParserValue } from "./YearParser.js";
|
5 |
+
export declare class LocalWeekYearParser extends Parser<YearParserValue> {
|
6 |
+
priority: number;
|
7 |
+
parse(
|
8 |
+
dateString: string,
|
9 |
+
token: string,
|
10 |
+
match: Match,
|
11 |
+
): ParseResult<YearParserValue>;
|
12 |
+
validate<DateType extends Date>(
|
13 |
+
_date: DateType,
|
14 |
+
value: YearParserValue,
|
15 |
+
): boolean;
|
16 |
+
set<DateType extends Date>(
|
17 |
+
date: DateType,
|
18 |
+
flags: ParseFlags,
|
19 |
+
value: YearParserValue,
|
20 |
+
options: ParserOptions,
|
21 |
+
): DateType;
|
22 |
+
incompatibleTokens: string[];
|
23 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.LocalWeekYearParser = void 0;
|
3 |
+
var _index = require("../../../getWeekYear.js");
|
4 |
+
|
5 |
+
var _index2 = require("../../../startOfWeek.js");
|
6 |
+
var _Parser = require("../Parser.js");
|
7 |
+
|
8 |
+
var _utils = require("../utils.js");
|
9 |
+
|
10 |
+
// Local week-numbering year
|
11 |
+
class LocalWeekYearParser extends _Parser.Parser {
|
12 |
+
priority = 130;
|
13 |
+
|
14 |
+
parse(dateString, token, match) {
|
15 |
+
const valueCallback = (year) => ({
|
16 |
+
year,
|
17 |
+
isTwoDigitYear: token === "YY",
|
18 |
+
});
|
19 |
+
|
20 |
+
switch (token) {
|
21 |
+
case "Y":
|
22 |
+
return (0, _utils.mapValue)(
|
23 |
+
(0, _utils.parseNDigits)(4, dateString),
|
24 |
+
valueCallback,
|
25 |
+
);
|
26 |
+
case "Yo":
|
27 |
+
return (0, _utils.mapValue)(
|
28 |
+
match.ordinalNumber(dateString, {
|
29 |
+
unit: "year",
|
30 |
+
}),
|
31 |
+
valueCallback,
|
32 |
+
);
|
33 |
+
default:
|
34 |
+
return (0, _utils.mapValue)(
|
35 |
+
(0, _utils.parseNDigits)(token.length, dateString),
|
36 |
+
valueCallback,
|
37 |
+
);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
validate(_date, value) {
|
42 |
+
return value.isTwoDigitYear || value.year > 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
set(date, flags, value, options) {
|
46 |
+
const currentYear = (0, _index.getWeekYear)(date, options);
|
47 |
+
|
48 |
+
if (value.isTwoDigitYear) {
|
49 |
+
const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(
|
50 |
+
value.year,
|
51 |
+
currentYear,
|
52 |
+
);
|
53 |
+
date.setFullYear(
|
54 |
+
normalizedTwoDigitYear,
|
55 |
+
0,
|
56 |
+
options.firstWeekContainsDate,
|
57 |
+
);
|
58 |
+
date.setHours(0, 0, 0, 0);
|
59 |
+
return (0, _index2.startOfWeek)(date, options);
|
60 |
+
}
|
61 |
+
|
62 |
+
const year =
|
63 |
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
64 |
+
date.setFullYear(year, 0, options.firstWeekContainsDate);
|
65 |
+
date.setHours(0, 0, 0, 0);
|
66 |
+
return (0, _index2.startOfWeek)(date, options);
|
67 |
+
}
|
68 |
+
|
69 |
+
incompatibleTokens = [
|
70 |
+
"y",
|
71 |
+
"R",
|
72 |
+
"u",
|
73 |
+
"Q",
|
74 |
+
"q",
|
75 |
+
"M",
|
76 |
+
"L",
|
77 |
+
"I",
|
78 |
+
"d",
|
79 |
+
"D",
|
80 |
+
"i",
|
81 |
+
"t",
|
82 |
+
"T",
|
83 |
+
];
|
84 |
+
}
|
85 |
+
exports.LocalWeekYearParser = LocalWeekYearParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getWeekYear } from "../../../getWeekYear.mjs";
|
2 |
+
import { startOfWeek } from "../../../startOfWeek.mjs";
|
3 |
+
import { Parser } from "../Parser.mjs";
|
4 |
+
import { mapValue, normalizeTwoDigitYear, parseNDigits } from "../utils.mjs";
|
5 |
+
|
6 |
+
// Local week-numbering year
|
7 |
+
export class LocalWeekYearParser extends Parser {
|
8 |
+
priority = 130;
|
9 |
+
|
10 |
+
parse(dateString, token, match) {
|
11 |
+
const valueCallback = (year) => ({
|
12 |
+
year,
|
13 |
+
isTwoDigitYear: token === "YY",
|
14 |
+
});
|
15 |
+
|
16 |
+
switch (token) {
|
17 |
+
case "Y":
|
18 |
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
19 |
+
case "Yo":
|
20 |
+
return mapValue(
|
21 |
+
match.ordinalNumber(dateString, {
|
22 |
+
unit: "year",
|
23 |
+
}),
|
24 |
+
valueCallback,
|
25 |
+
);
|
26 |
+
default:
|
27 |
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
validate(_date, value) {
|
32 |
+
return value.isTwoDigitYear || value.year > 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
set(date, flags, value, options) {
|
36 |
+
const currentYear = getWeekYear(date, options);
|
37 |
+
|
38 |
+
if (value.isTwoDigitYear) {
|
39 |
+
const normalizedTwoDigitYear = normalizeTwoDigitYear(
|
40 |
+
value.year,
|
41 |
+
currentYear,
|
42 |
+
);
|
43 |
+
date.setFullYear(
|
44 |
+
normalizedTwoDigitYear,
|
45 |
+
0,
|
46 |
+
options.firstWeekContainsDate,
|
47 |
+
);
|
48 |
+
date.setHours(0, 0, 0, 0);
|
49 |
+
return startOfWeek(date, options);
|
50 |
+
}
|
51 |
+
|
52 |
+
const year =
|
53 |
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
54 |
+
date.setFullYear(year, 0, options.firstWeekContainsDate);
|
55 |
+
date.setHours(0, 0, 0, 0);
|
56 |
+
return startOfWeek(date, options);
|
57 |
+
}
|
58 |
+
|
59 |
+
incompatibleTokens = [
|
60 |
+
"y",
|
61 |
+
"R",
|
62 |
+
"u",
|
63 |
+
"Q",
|
64 |
+
"q",
|
65 |
+
"M",
|
66 |
+
"L",
|
67 |
+
"I",
|
68 |
+
"d",
|
69 |
+
"D",
|
70 |
+
"i",
|
71 |
+
"t",
|
72 |
+
"T",
|
73 |
+
];
|
74 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class MinuteParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class MinuteParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.MinuteParser = void 0;
|
3 |
+
var _constants = require("../constants.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class MinuteParser extends _Parser.Parser {
|
9 |
+
priority = 60;
|
10 |
+
|
11 |
+
parse(dateString, token, match) {
|
12 |
+
switch (token) {
|
13 |
+
case "m":
|
14 |
+
return (0, _utils.parseNumericPattern)(
|
15 |
+
_constants.numericPatterns.minute,
|
16 |
+
dateString,
|
17 |
+
);
|
18 |
+
case "mo":
|
19 |
+
return match.ordinalNumber(dateString, { unit: "minute" });
|
20 |
+
default:
|
21 |
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
validate(_date, value) {
|
26 |
+
return value >= 0 && value <= 59;
|
27 |
+
}
|
28 |
+
|
29 |
+
set(date, _flags, value) {
|
30 |
+
date.setMinutes(value, 0, 0);
|
31 |
+
return date;
|
32 |
+
}
|
33 |
+
|
34 |
+
incompatibleTokens = ["t", "T"];
|
35 |
+
}
|
36 |
+
exports.MinuteParser = MinuteParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { numericPatterns } from "../constants.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class MinuteParser extends Parser {
|
6 |
+
priority = 60;
|
7 |
+
|
8 |
+
parse(dateString, token, match) {
|
9 |
+
switch (token) {
|
10 |
+
case "m":
|
11 |
+
return parseNumericPattern(numericPatterns.minute, dateString);
|
12 |
+
case "mo":
|
13 |
+
return match.ordinalNumber(dateString, { unit: "minute" });
|
14 |
+
default:
|
15 |
+
return parseNDigits(token.length, dateString);
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
validate(_date, value) {
|
20 |
+
return value >= 0 && value <= 59;
|
21 |
+
}
|
22 |
+
|
23 |
+
set(date, _flags, value) {
|
24 |
+
date.setMinutes(value, 0, 0);
|
25 |
+
return date;
|
26 |
+
}
|
27 |
+
|
28 |
+
incompatibleTokens = ["t", "T"];
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class MonthParser extends Parser<number> {
|
5 |
+
incompatibleTokens: string[];
|
6 |
+
priority: number;
|
7 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
8 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
9 |
+
set<DateType extends Date>(
|
10 |
+
date: DateType,
|
11 |
+
_flags: ParseFlags,
|
12 |
+
value: number,
|
13 |
+
): DateType;
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class MonthParser extends Parser<number> {
|
5 |
+
incompatibleTokens: string[];
|
6 |
+
priority: number;
|
7 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
8 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
9 |
+
set<DateType extends Date>(
|
10 |
+
date: DateType,
|
11 |
+
_flags: ParseFlags,
|
12 |
+
value: number,
|
13 |
+
): DateType;
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.MonthParser = void 0;
|
3 |
+
var _constants = require("../constants.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class MonthParser extends _Parser.Parser {
|
9 |
+
incompatibleTokens = [
|
10 |
+
"Y",
|
11 |
+
"R",
|
12 |
+
"q",
|
13 |
+
"Q",
|
14 |
+
"L",
|
15 |
+
"w",
|
16 |
+
"I",
|
17 |
+
"D",
|
18 |
+
"i",
|
19 |
+
"e",
|
20 |
+
"c",
|
21 |
+
"t",
|
22 |
+
"T",
|
23 |
+
];
|
24 |
+
|
25 |
+
priority = 110;
|
26 |
+
|
27 |
+
parse(dateString, token, match) {
|
28 |
+
const valueCallback = (value) => value - 1;
|
29 |
+
|
30 |
+
switch (token) {
|
31 |
+
// 1, 2, ..., 12
|
32 |
+
case "M":
|
33 |
+
return (0, _utils.mapValue)(
|
34 |
+
(0, _utils.parseNumericPattern)(
|
35 |
+
_constants.numericPatterns.month,
|
36 |
+
dateString,
|
37 |
+
),
|
38 |
+
valueCallback,
|
39 |
+
);
|
40 |
+
// 01, 02, ..., 12
|
41 |
+
case "MM":
|
42 |
+
return (0, _utils.mapValue)(
|
43 |
+
(0, _utils.parseNDigits)(2, dateString),
|
44 |
+
valueCallback,
|
45 |
+
);
|
46 |
+
// 1st, 2nd, ..., 12th
|
47 |
+
case "Mo":
|
48 |
+
return (0, _utils.mapValue)(
|
49 |
+
match.ordinalNumber(dateString, {
|
50 |
+
unit: "month",
|
51 |
+
}),
|
52 |
+
valueCallback,
|
53 |
+
);
|
54 |
+
// Jan, Feb, ..., Dec
|
55 |
+
case "MMM":
|
56 |
+
return (
|
57 |
+
match.month(dateString, {
|
58 |
+
width: "abbreviated",
|
59 |
+
context: "formatting",
|
60 |
+
}) ||
|
61 |
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
62 |
+
);
|
63 |
+
|
64 |
+
// J, F, ..., D
|
65 |
+
case "MMMMM":
|
66 |
+
return match.month(dateString, {
|
67 |
+
width: "narrow",
|
68 |
+
context: "formatting",
|
69 |
+
});
|
70 |
+
// January, February, ..., December
|
71 |
+
case "MMMM":
|
72 |
+
default:
|
73 |
+
return (
|
74 |
+
match.month(dateString, { width: "wide", context: "formatting" }) ||
|
75 |
+
match.month(dateString, {
|
76 |
+
width: "abbreviated",
|
77 |
+
context: "formatting",
|
78 |
+
}) ||
|
79 |
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
80 |
+
);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
validate(_date, value) {
|
85 |
+
return value >= 0 && value <= 11;
|
86 |
+
}
|
87 |
+
|
88 |
+
set(date, _flags, value) {
|
89 |
+
date.setMonth(value, 1);
|
90 |
+
date.setHours(0, 0, 0, 0);
|
91 |
+
return date;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
exports.MonthParser = MonthParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { numericPatterns } from "../constants.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { mapValue, parseNDigits, parseNumericPattern } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class MonthParser extends Parser {
|
6 |
+
incompatibleTokens = [
|
7 |
+
"Y",
|
8 |
+
"R",
|
9 |
+
"q",
|
10 |
+
"Q",
|
11 |
+
"L",
|
12 |
+
"w",
|
13 |
+
"I",
|
14 |
+
"D",
|
15 |
+
"i",
|
16 |
+
"e",
|
17 |
+
"c",
|
18 |
+
"t",
|
19 |
+
"T",
|
20 |
+
];
|
21 |
+
|
22 |
+
priority = 110;
|
23 |
+
|
24 |
+
parse(dateString, token, match) {
|
25 |
+
const valueCallback = (value) => value - 1;
|
26 |
+
|
27 |
+
switch (token) {
|
28 |
+
// 1, 2, ..., 12
|
29 |
+
case "M":
|
30 |
+
return mapValue(
|
31 |
+
parseNumericPattern(numericPatterns.month, dateString),
|
32 |
+
valueCallback,
|
33 |
+
);
|
34 |
+
// 01, 02, ..., 12
|
35 |
+
case "MM":
|
36 |
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
37 |
+
// 1st, 2nd, ..., 12th
|
38 |
+
case "Mo":
|
39 |
+
return mapValue(
|
40 |
+
match.ordinalNumber(dateString, {
|
41 |
+
unit: "month",
|
42 |
+
}),
|
43 |
+
valueCallback,
|
44 |
+
);
|
45 |
+
// Jan, Feb, ..., Dec
|
46 |
+
case "MMM":
|
47 |
+
return (
|
48 |
+
match.month(dateString, {
|
49 |
+
width: "abbreviated",
|
50 |
+
context: "formatting",
|
51 |
+
}) ||
|
52 |
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
53 |
+
);
|
54 |
+
|
55 |
+
// J, F, ..., D
|
56 |
+
case "MMMMM":
|
57 |
+
return match.month(dateString, {
|
58 |
+
width: "narrow",
|
59 |
+
context: "formatting",
|
60 |
+
});
|
61 |
+
// January, February, ..., December
|
62 |
+
case "MMMM":
|
63 |
+
default:
|
64 |
+
return (
|
65 |
+
match.month(dateString, { width: "wide", context: "formatting" }) ||
|
66 |
+
match.month(dateString, {
|
67 |
+
width: "abbreviated",
|
68 |
+
context: "formatting",
|
69 |
+
}) ||
|
70 |
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
71 |
+
);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
validate(_date, value) {
|
76 |
+
return value >= 0 && value <= 11;
|
77 |
+
}
|
78 |
+
|
79 |
+
set(date, _flags, value) {
|
80 |
+
date.setMonth(value, 1);
|
81 |
+
date.setHours(0, 0, 0, 0);
|
82 |
+
return date;
|
83 |
+
}
|
84 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class QuarterParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class QuarterParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.QuarterParser = void 0;
|
3 |
+
var _Parser = require("../Parser.js");
|
4 |
+
|
5 |
+
var _utils = require("../utils.js");
|
6 |
+
|
7 |
+
class QuarterParser extends _Parser.Parser {
|
8 |
+
priority = 120;
|
9 |
+
|
10 |
+
parse(dateString, token, match) {
|
11 |
+
switch (token) {
|
12 |
+
// 1, 2, 3, 4
|
13 |
+
case "Q":
|
14 |
+
case "QQ": // 01, 02, 03, 04
|
15 |
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
16 |
+
// 1st, 2nd, 3rd, 4th
|
17 |
+
case "Qo":
|
18 |
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
19 |
+
// Q1, Q2, Q3, Q4
|
20 |
+
case "QQQ":
|
21 |
+
return (
|
22 |
+
match.quarter(dateString, {
|
23 |
+
width: "abbreviated",
|
24 |
+
context: "formatting",
|
25 |
+
}) ||
|
26 |
+
match.quarter(dateString, {
|
27 |
+
width: "narrow",
|
28 |
+
context: "formatting",
|
29 |
+
})
|
30 |
+
);
|
31 |
+
|
32 |
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
33 |
+
case "QQQQQ":
|
34 |
+
return match.quarter(dateString, {
|
35 |
+
width: "narrow",
|
36 |
+
context: "formatting",
|
37 |
+
});
|
38 |
+
// 1st quarter, 2nd quarter, ...
|
39 |
+
case "QQQQ":
|
40 |
+
default:
|
41 |
+
return (
|
42 |
+
match.quarter(dateString, {
|
43 |
+
width: "wide",
|
44 |
+
context: "formatting",
|
45 |
+
}) ||
|
46 |
+
match.quarter(dateString, {
|
47 |
+
width: "abbreviated",
|
48 |
+
context: "formatting",
|
49 |
+
}) ||
|
50 |
+
match.quarter(dateString, {
|
51 |
+
width: "narrow",
|
52 |
+
context: "formatting",
|
53 |
+
})
|
54 |
+
);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
validate(_date, value) {
|
59 |
+
return value >= 1 && value <= 4;
|
60 |
+
}
|
61 |
+
|
62 |
+
set(date, _flags, value) {
|
63 |
+
date.setMonth((value - 1) * 3, 1);
|
64 |
+
date.setHours(0, 0, 0, 0);
|
65 |
+
return date;
|
66 |
+
}
|
67 |
+
|
68 |
+
incompatibleTokens = [
|
69 |
+
"Y",
|
70 |
+
"R",
|
71 |
+
"q",
|
72 |
+
"M",
|
73 |
+
"L",
|
74 |
+
"w",
|
75 |
+
"I",
|
76 |
+
"d",
|
77 |
+
"D",
|
78 |
+
"i",
|
79 |
+
"e",
|
80 |
+
"c",
|
81 |
+
"t",
|
82 |
+
"T",
|
83 |
+
];
|
84 |
+
}
|
85 |
+
exports.QuarterParser = QuarterParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.mjs";
|
2 |
+
import { parseNDigits } from "../utils.mjs";
|
3 |
+
|
4 |
+
export class QuarterParser extends Parser {
|
5 |
+
priority = 120;
|
6 |
+
|
7 |
+
parse(dateString, token, match) {
|
8 |
+
switch (token) {
|
9 |
+
// 1, 2, 3, 4
|
10 |
+
case "Q":
|
11 |
+
case "QQ": // 01, 02, 03, 04
|
12 |
+
return parseNDigits(token.length, dateString);
|
13 |
+
// 1st, 2nd, 3rd, 4th
|
14 |
+
case "Qo":
|
15 |
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
16 |
+
// Q1, Q2, Q3, Q4
|
17 |
+
case "QQQ":
|
18 |
+
return (
|
19 |
+
match.quarter(dateString, {
|
20 |
+
width: "abbreviated",
|
21 |
+
context: "formatting",
|
22 |
+
}) ||
|
23 |
+
match.quarter(dateString, {
|
24 |
+
width: "narrow",
|
25 |
+
context: "formatting",
|
26 |
+
})
|
27 |
+
);
|
28 |
+
|
29 |
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
30 |
+
case "QQQQQ":
|
31 |
+
return match.quarter(dateString, {
|
32 |
+
width: "narrow",
|
33 |
+
context: "formatting",
|
34 |
+
});
|
35 |
+
// 1st quarter, 2nd quarter, ...
|
36 |
+
case "QQQQ":
|
37 |
+
default:
|
38 |
+
return (
|
39 |
+
match.quarter(dateString, {
|
40 |
+
width: "wide",
|
41 |
+
context: "formatting",
|
42 |
+
}) ||
|
43 |
+
match.quarter(dateString, {
|
44 |
+
width: "abbreviated",
|
45 |
+
context: "formatting",
|
46 |
+
}) ||
|
47 |
+
match.quarter(dateString, {
|
48 |
+
width: "narrow",
|
49 |
+
context: "formatting",
|
50 |
+
})
|
51 |
+
);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
validate(_date, value) {
|
56 |
+
return value >= 1 && value <= 4;
|
57 |
+
}
|
58 |
+
|
59 |
+
set(date, _flags, value) {
|
60 |
+
date.setMonth((value - 1) * 3, 1);
|
61 |
+
date.setHours(0, 0, 0, 0);
|
62 |
+
return date;
|
63 |
+
}
|
64 |
+
|
65 |
+
incompatibleTokens = [
|
66 |
+
"Y",
|
67 |
+
"R",
|
68 |
+
"q",
|
69 |
+
"M",
|
70 |
+
"L",
|
71 |
+
"w",
|
72 |
+
"I",
|
73 |
+
"d",
|
74 |
+
"D",
|
75 |
+
"i",
|
76 |
+
"e",
|
77 |
+
"c",
|
78 |
+
"t",
|
79 |
+
"T",
|
80 |
+
];
|
81 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class SecondParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class SecondParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.SecondParser = void 0;
|
3 |
+
var _constants = require("../constants.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class SecondParser extends _Parser.Parser {
|
9 |
+
priority = 50;
|
10 |
+
|
11 |
+
parse(dateString, token, match) {
|
12 |
+
switch (token) {
|
13 |
+
case "s":
|
14 |
+
return (0, _utils.parseNumericPattern)(
|
15 |
+
_constants.numericPatterns.second,
|
16 |
+
dateString,
|
17 |
+
);
|
18 |
+
case "so":
|
19 |
+
return match.ordinalNumber(dateString, { unit: "second" });
|
20 |
+
default:
|
21 |
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
validate(_date, value) {
|
26 |
+
return value >= 0 && value <= 59;
|
27 |
+
}
|
28 |
+
|
29 |
+
set(date, _flags, value) {
|
30 |
+
date.setSeconds(value, 0);
|
31 |
+
return date;
|
32 |
+
}
|
33 |
+
|
34 |
+
incompatibleTokens = ["t", "T"];
|
35 |
+
}
|
36 |
+
exports.SecondParser = SecondParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { numericPatterns } from "../constants.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class SecondParser extends Parser {
|
6 |
+
priority = 50;
|
7 |
+
|
8 |
+
parse(dateString, token, match) {
|
9 |
+
switch (token) {
|
10 |
+
case "s":
|
11 |
+
return parseNumericPattern(numericPatterns.second, dateString);
|
12 |
+
case "so":
|
13 |
+
return match.ordinalNumber(dateString, { unit: "second" });
|
14 |
+
default:
|
15 |
+
return parseNDigits(token.length, dateString);
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
validate(_date, value) {
|
20 |
+
return value >= 0 && value <= 59;
|
21 |
+
}
|
22 |
+
|
23 |
+
set(date, _flags, value) {
|
24 |
+
date.setSeconds(value, 0);
|
25 |
+
return date;
|
26 |
+
}
|
27 |
+
|
28 |
+
incompatibleTokens = ["t", "T"];
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.d.mts
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
export declare class StandAloneLocalDayParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(
|
7 |
+
dateString: string,
|
8 |
+
token: string,
|
9 |
+
match: Match,
|
10 |
+
options: ParserOptions,
|
11 |
+
): ParseResult<number>;
|
12 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
13 |
+
set<DateType extends Date>(
|
14 |
+
date: DateType,
|
15 |
+
_flags: ParseFlags,
|
16 |
+
value: number,
|
17 |
+
options: ParserOptions,
|
18 |
+
): DateType;
|
19 |
+
incompatibleTokens: string[];
|
20 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.d.ts
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
|
4 |
+
export declare class StandAloneLocalDayParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(
|
7 |
+
dateString: string,
|
8 |
+
token: string,
|
9 |
+
match: Match,
|
10 |
+
options: ParserOptions,
|
11 |
+
): ParseResult<number>;
|
12 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
13 |
+
set<DateType extends Date>(
|
14 |
+
date: DateType,
|
15 |
+
_flags: ParseFlags,
|
16 |
+
value: number,
|
17 |
+
options: ParserOptions,
|
18 |
+
): DateType;
|
19 |
+
incompatibleTokens: string[];
|
20 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.StandAloneLocalDayParser = void 0;
|
3 |
+
var _index = require("../../../setDay.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
// Stand-alone local day of week
|
9 |
+
class StandAloneLocalDayParser extends _Parser.Parser {
|
10 |
+
priority = 90;
|
11 |
+
|
12 |
+
parse(dateString, token, match, options) {
|
13 |
+
const valueCallback = (value) => {
|
14 |
+
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
|
15 |
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
16 |
+
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
|
17 |
+
};
|
18 |
+
|
19 |
+
switch (token) {
|
20 |
+
// 3
|
21 |
+
case "c":
|
22 |
+
case "cc": // 03
|
23 |
+
return (0, _utils.mapValue)(
|
24 |
+
(0, _utils.parseNDigits)(token.length, dateString),
|
25 |
+
valueCallback,
|
26 |
+
);
|
27 |
+
// 3rd
|
28 |
+
case "co":
|
29 |
+
return (0, _utils.mapValue)(
|
30 |
+
match.ordinalNumber(dateString, {
|
31 |
+
unit: "day",
|
32 |
+
}),
|
33 |
+
valueCallback,
|
34 |
+
);
|
35 |
+
// Tue
|
36 |
+
case "ccc":
|
37 |
+
return (
|
38 |
+
match.day(dateString, {
|
39 |
+
width: "abbreviated",
|
40 |
+
context: "standalone",
|
41 |
+
}) ||
|
42 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
43 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
44 |
+
);
|
45 |
+
|
46 |
+
// T
|
47 |
+
case "ccccc":
|
48 |
+
return match.day(dateString, {
|
49 |
+
width: "narrow",
|
50 |
+
context: "standalone",
|
51 |
+
});
|
52 |
+
// Tu
|
53 |
+
case "cccccc":
|
54 |
+
return (
|
55 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
56 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
57 |
+
);
|
58 |
+
|
59 |
+
// Tuesday
|
60 |
+
case "cccc":
|
61 |
+
default:
|
62 |
+
return (
|
63 |
+
match.day(dateString, { width: "wide", context: "standalone" }) ||
|
64 |
+
match.day(dateString, {
|
65 |
+
width: "abbreviated",
|
66 |
+
context: "standalone",
|
67 |
+
}) ||
|
68 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
69 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
70 |
+
);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
validate(_date, value) {
|
75 |
+
return value >= 0 && value <= 6;
|
76 |
+
}
|
77 |
+
|
78 |
+
set(date, _flags, value, options) {
|
79 |
+
date = (0, _index.setDay)(date, value, options);
|
80 |
+
date.setHours(0, 0, 0, 0);
|
81 |
+
return date;
|
82 |
+
}
|
83 |
+
|
84 |
+
incompatibleTokens = [
|
85 |
+
"y",
|
86 |
+
"R",
|
87 |
+
"u",
|
88 |
+
"q",
|
89 |
+
"Q",
|
90 |
+
"M",
|
91 |
+
"L",
|
92 |
+
"I",
|
93 |
+
"d",
|
94 |
+
"D",
|
95 |
+
"E",
|
96 |
+
"i",
|
97 |
+
"e",
|
98 |
+
"t",
|
99 |
+
"T",
|
100 |
+
];
|
101 |
+
}
|
102 |
+
exports.StandAloneLocalDayParser = StandAloneLocalDayParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { setDay } from "../../../setDay.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { mapValue, parseNDigits } from "../utils.mjs";
|
4 |
+
|
5 |
+
// Stand-alone local day of week
|
6 |
+
export class StandAloneLocalDayParser extends Parser {
|
7 |
+
priority = 90;
|
8 |
+
|
9 |
+
parse(dateString, token, match, options) {
|
10 |
+
const valueCallback = (value) => {
|
11 |
+
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
|
12 |
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
13 |
+
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
|
14 |
+
};
|
15 |
+
|
16 |
+
switch (token) {
|
17 |
+
// 3
|
18 |
+
case "c":
|
19 |
+
case "cc": // 03
|
20 |
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
21 |
+
// 3rd
|
22 |
+
case "co":
|
23 |
+
return mapValue(
|
24 |
+
match.ordinalNumber(dateString, {
|
25 |
+
unit: "day",
|
26 |
+
}),
|
27 |
+
valueCallback,
|
28 |
+
);
|
29 |
+
// Tue
|
30 |
+
case "ccc":
|
31 |
+
return (
|
32 |
+
match.day(dateString, {
|
33 |
+
width: "abbreviated",
|
34 |
+
context: "standalone",
|
35 |
+
}) ||
|
36 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
37 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
38 |
+
);
|
39 |
+
|
40 |
+
// T
|
41 |
+
case "ccccc":
|
42 |
+
return match.day(dateString, {
|
43 |
+
width: "narrow",
|
44 |
+
context: "standalone",
|
45 |
+
});
|
46 |
+
// Tu
|
47 |
+
case "cccccc":
|
48 |
+
return (
|
49 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
50 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
51 |
+
);
|
52 |
+
|
53 |
+
// Tuesday
|
54 |
+
case "cccc":
|
55 |
+
default:
|
56 |
+
return (
|
57 |
+
match.day(dateString, { width: "wide", context: "standalone" }) ||
|
58 |
+
match.day(dateString, {
|
59 |
+
width: "abbreviated",
|
60 |
+
context: "standalone",
|
61 |
+
}) ||
|
62 |
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
63 |
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
64 |
+
);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
validate(_date, value) {
|
69 |
+
return value >= 0 && value <= 6;
|
70 |
+
}
|
71 |
+
|
72 |
+
set(date, _flags, value, options) {
|
73 |
+
date = setDay(date, value, options);
|
74 |
+
date.setHours(0, 0, 0, 0);
|
75 |
+
return date;
|
76 |
+
}
|
77 |
+
|
78 |
+
incompatibleTokens = [
|
79 |
+
"y",
|
80 |
+
"R",
|
81 |
+
"u",
|
82 |
+
"q",
|
83 |
+
"Q",
|
84 |
+
"M",
|
85 |
+
"L",
|
86 |
+
"I",
|
87 |
+
"d",
|
88 |
+
"D",
|
89 |
+
"E",
|
90 |
+
"i",
|
91 |
+
"e",
|
92 |
+
"t",
|
93 |
+
"T",
|
94 |
+
];
|
95 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class StandAloneMonthParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class StandAloneMonthParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.StandAloneMonthParser = void 0;
|
3 |
+
var _constants = require("../constants.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class StandAloneMonthParser extends _Parser.Parser {
|
9 |
+
priority = 110;
|
10 |
+
|
11 |
+
parse(dateString, token, match) {
|
12 |
+
const valueCallback = (value) => value - 1;
|
13 |
+
|
14 |
+
switch (token) {
|
15 |
+
// 1, 2, ..., 12
|
16 |
+
case "L":
|
17 |
+
return (0, _utils.mapValue)(
|
18 |
+
(0, _utils.parseNumericPattern)(
|
19 |
+
_constants.numericPatterns.month,
|
20 |
+
dateString,
|
21 |
+
),
|
22 |
+
valueCallback,
|
23 |
+
);
|
24 |
+
// 01, 02, ..., 12
|
25 |
+
case "LL":
|
26 |
+
return (0, _utils.mapValue)(
|
27 |
+
(0, _utils.parseNDigits)(2, dateString),
|
28 |
+
valueCallback,
|
29 |
+
);
|
30 |
+
// 1st, 2nd, ..., 12th
|
31 |
+
case "Lo":
|
32 |
+
return (0, _utils.mapValue)(
|
33 |
+
match.ordinalNumber(dateString, {
|
34 |
+
unit: "month",
|
35 |
+
}),
|
36 |
+
valueCallback,
|
37 |
+
);
|
38 |
+
// Jan, Feb, ..., Dec
|
39 |
+
case "LLL":
|
40 |
+
return (
|
41 |
+
match.month(dateString, {
|
42 |
+
width: "abbreviated",
|
43 |
+
context: "standalone",
|
44 |
+
}) ||
|
45 |
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
46 |
+
);
|
47 |
+
|
48 |
+
// J, F, ..., D
|
49 |
+
case "LLLLL":
|
50 |
+
return match.month(dateString, {
|
51 |
+
width: "narrow",
|
52 |
+
context: "standalone",
|
53 |
+
});
|
54 |
+
// January, February, ..., December
|
55 |
+
case "LLLL":
|
56 |
+
default:
|
57 |
+
return (
|
58 |
+
match.month(dateString, { width: "wide", context: "standalone" }) ||
|
59 |
+
match.month(dateString, {
|
60 |
+
width: "abbreviated",
|
61 |
+
context: "standalone",
|
62 |
+
}) ||
|
63 |
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
64 |
+
);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
validate(_date, value) {
|
69 |
+
return value >= 0 && value <= 11;
|
70 |
+
}
|
71 |
+
|
72 |
+
set(date, _flags, value) {
|
73 |
+
date.setMonth(value, 1);
|
74 |
+
date.setHours(0, 0, 0, 0);
|
75 |
+
return date;
|
76 |
+
}
|
77 |
+
|
78 |
+
incompatibleTokens = [
|
79 |
+
"Y",
|
80 |
+
"R",
|
81 |
+
"q",
|
82 |
+
"Q",
|
83 |
+
"M",
|
84 |
+
"w",
|
85 |
+
"I",
|
86 |
+
"D",
|
87 |
+
"i",
|
88 |
+
"e",
|
89 |
+
"c",
|
90 |
+
"t",
|
91 |
+
"T",
|
92 |
+
];
|
93 |
+
}
|
94 |
+
exports.StandAloneMonthParser = StandAloneMonthParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { numericPatterns } from "../constants.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { mapValue, parseNDigits, parseNumericPattern } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class StandAloneMonthParser extends Parser {
|
6 |
+
priority = 110;
|
7 |
+
|
8 |
+
parse(dateString, token, match) {
|
9 |
+
const valueCallback = (value) => value - 1;
|
10 |
+
|
11 |
+
switch (token) {
|
12 |
+
// 1, 2, ..., 12
|
13 |
+
case "L":
|
14 |
+
return mapValue(
|
15 |
+
parseNumericPattern(numericPatterns.month, dateString),
|
16 |
+
valueCallback,
|
17 |
+
);
|
18 |
+
// 01, 02, ..., 12
|
19 |
+
case "LL":
|
20 |
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
21 |
+
// 1st, 2nd, ..., 12th
|
22 |
+
case "Lo":
|
23 |
+
return mapValue(
|
24 |
+
match.ordinalNumber(dateString, {
|
25 |
+
unit: "month",
|
26 |
+
}),
|
27 |
+
valueCallback,
|
28 |
+
);
|
29 |
+
// Jan, Feb, ..., Dec
|
30 |
+
case "LLL":
|
31 |
+
return (
|
32 |
+
match.month(dateString, {
|
33 |
+
width: "abbreviated",
|
34 |
+
context: "standalone",
|
35 |
+
}) ||
|
36 |
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
37 |
+
);
|
38 |
+
|
39 |
+
// J, F, ..., D
|
40 |
+
case "LLLLL":
|
41 |
+
return match.month(dateString, {
|
42 |
+
width: "narrow",
|
43 |
+
context: "standalone",
|
44 |
+
});
|
45 |
+
// January, February, ..., December
|
46 |
+
case "LLLL":
|
47 |
+
default:
|
48 |
+
return (
|
49 |
+
match.month(dateString, { width: "wide", context: "standalone" }) ||
|
50 |
+
match.month(dateString, {
|
51 |
+
width: "abbreviated",
|
52 |
+
context: "standalone",
|
53 |
+
}) ||
|
54 |
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
55 |
+
);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
validate(_date, value) {
|
60 |
+
return value >= 0 && value <= 11;
|
61 |
+
}
|
62 |
+
|
63 |
+
set(date, _flags, value) {
|
64 |
+
date.setMonth(value, 1);
|
65 |
+
date.setHours(0, 0, 0, 0);
|
66 |
+
return date;
|
67 |
+
}
|
68 |
+
|
69 |
+
incompatibleTokens = [
|
70 |
+
"Y",
|
71 |
+
"R",
|
72 |
+
"q",
|
73 |
+
"Q",
|
74 |
+
"M",
|
75 |
+
"w",
|
76 |
+
"I",
|
77 |
+
"D",
|
78 |
+
"i",
|
79 |
+
"e",
|
80 |
+
"c",
|
81 |
+
"t",
|
82 |
+
"T",
|
83 |
+
];
|
84 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.d.mts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class StandAloneQuarterParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export declare class StandAloneQuarterParser extends Parser<number> {
|
5 |
+
priority: number;
|
6 |
+
parse(dateString: string, token: string, match: Match): ParseResult<number>;
|
7 |
+
validate<DateType extends Date>(_date: DateType, value: number): boolean;
|
8 |
+
set<DateType extends Date>(
|
9 |
+
date: DateType,
|
10 |
+
_flags: ParseFlags,
|
11 |
+
value: number,
|
12 |
+
): DateType;
|
13 |
+
incompatibleTokens: string[];
|
14 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.StandAloneQuarterParser = void 0;
|
3 |
+
var _Parser = require("../Parser.js");
|
4 |
+
|
5 |
+
var _utils = require("../utils.js");
|
6 |
+
|
7 |
+
class StandAloneQuarterParser extends _Parser.Parser {
|
8 |
+
priority = 120;
|
9 |
+
|
10 |
+
parse(dateString, token, match) {
|
11 |
+
switch (token) {
|
12 |
+
// 1, 2, 3, 4
|
13 |
+
case "q":
|
14 |
+
case "qq": // 01, 02, 03, 04
|
15 |
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
16 |
+
// 1st, 2nd, 3rd, 4th
|
17 |
+
case "qo":
|
18 |
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
19 |
+
// Q1, Q2, Q3, Q4
|
20 |
+
case "qqq":
|
21 |
+
return (
|
22 |
+
match.quarter(dateString, {
|
23 |
+
width: "abbreviated",
|
24 |
+
context: "standalone",
|
25 |
+
}) ||
|
26 |
+
match.quarter(dateString, {
|
27 |
+
width: "narrow",
|
28 |
+
context: "standalone",
|
29 |
+
})
|
30 |
+
);
|
31 |
+
|
32 |
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
33 |
+
case "qqqqq":
|
34 |
+
return match.quarter(dateString, {
|
35 |
+
width: "narrow",
|
36 |
+
context: "standalone",
|
37 |
+
});
|
38 |
+
// 1st quarter, 2nd quarter, ...
|
39 |
+
case "qqqq":
|
40 |
+
default:
|
41 |
+
return (
|
42 |
+
match.quarter(dateString, {
|
43 |
+
width: "wide",
|
44 |
+
context: "standalone",
|
45 |
+
}) ||
|
46 |
+
match.quarter(dateString, {
|
47 |
+
width: "abbreviated",
|
48 |
+
context: "standalone",
|
49 |
+
}) ||
|
50 |
+
match.quarter(dateString, {
|
51 |
+
width: "narrow",
|
52 |
+
context: "standalone",
|
53 |
+
})
|
54 |
+
);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
validate(_date, value) {
|
59 |
+
return value >= 1 && value <= 4;
|
60 |
+
}
|
61 |
+
|
62 |
+
set(date, _flags, value) {
|
63 |
+
date.setMonth((value - 1) * 3, 1);
|
64 |
+
date.setHours(0, 0, 0, 0);
|
65 |
+
return date;
|
66 |
+
}
|
67 |
+
|
68 |
+
incompatibleTokens = [
|
69 |
+
"Y",
|
70 |
+
"R",
|
71 |
+
"Q",
|
72 |
+
"M",
|
73 |
+
"L",
|
74 |
+
"w",
|
75 |
+
"I",
|
76 |
+
"d",
|
77 |
+
"D",
|
78 |
+
"i",
|
79 |
+
"e",
|
80 |
+
"c",
|
81 |
+
"t",
|
82 |
+
"T",
|
83 |
+
];
|
84 |
+
}
|
85 |
+
exports.StandAloneQuarterParser = StandAloneQuarterParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.mjs";
|
2 |
+
import { parseNDigits } from "../utils.mjs";
|
3 |
+
|
4 |
+
export class StandAloneQuarterParser extends Parser {
|
5 |
+
priority = 120;
|
6 |
+
|
7 |
+
parse(dateString, token, match) {
|
8 |
+
switch (token) {
|
9 |
+
// 1, 2, 3, 4
|
10 |
+
case "q":
|
11 |
+
case "qq": // 01, 02, 03, 04
|
12 |
+
return parseNDigits(token.length, dateString);
|
13 |
+
// 1st, 2nd, 3rd, 4th
|
14 |
+
case "qo":
|
15 |
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
16 |
+
// Q1, Q2, Q3, Q4
|
17 |
+
case "qqq":
|
18 |
+
return (
|
19 |
+
match.quarter(dateString, {
|
20 |
+
width: "abbreviated",
|
21 |
+
context: "standalone",
|
22 |
+
}) ||
|
23 |
+
match.quarter(dateString, {
|
24 |
+
width: "narrow",
|
25 |
+
context: "standalone",
|
26 |
+
})
|
27 |
+
);
|
28 |
+
|
29 |
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
30 |
+
case "qqqqq":
|
31 |
+
return match.quarter(dateString, {
|
32 |
+
width: "narrow",
|
33 |
+
context: "standalone",
|
34 |
+
});
|
35 |
+
// 1st quarter, 2nd quarter, ...
|
36 |
+
case "qqqq":
|
37 |
+
default:
|
38 |
+
return (
|
39 |
+
match.quarter(dateString, {
|
40 |
+
width: "wide",
|
41 |
+
context: "standalone",
|
42 |
+
}) ||
|
43 |
+
match.quarter(dateString, {
|
44 |
+
width: "abbreviated",
|
45 |
+
context: "standalone",
|
46 |
+
}) ||
|
47 |
+
match.quarter(dateString, {
|
48 |
+
width: "narrow",
|
49 |
+
context: "standalone",
|
50 |
+
})
|
51 |
+
);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
validate(_date, value) {
|
56 |
+
return value >= 1 && value <= 4;
|
57 |
+
}
|
58 |
+
|
59 |
+
set(date, _flags, value) {
|
60 |
+
date.setMonth((value - 1) * 3, 1);
|
61 |
+
date.setHours(0, 0, 0, 0);
|
62 |
+
return date;
|
63 |
+
}
|
64 |
+
|
65 |
+
incompatibleTokens = [
|
66 |
+
"Y",
|
67 |
+
"R",
|
68 |
+
"Q",
|
69 |
+
"M",
|
70 |
+
"L",
|
71 |
+
"w",
|
72 |
+
"I",
|
73 |
+
"d",
|
74 |
+
"D",
|
75 |
+
"i",
|
76 |
+
"e",
|
77 |
+
"c",
|
78 |
+
"t",
|
79 |
+
"T",
|
80 |
+
];
|
81 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.d.mts
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.js";
|
2 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
3 |
+
export declare class TimestampMillisecondsParser extends Parser<number> {
|
4 |
+
priority: number;
|
5 |
+
parse(dateString: string): ParseResult<number>;
|
6 |
+
set<DateType extends Date>(
|
7 |
+
date: DateType,
|
8 |
+
_flags: ParseFlags,
|
9 |
+
value: number,
|
10 |
+
): [DateType, ParseFlags];
|
11 |
+
incompatibleTokens: "*";
|
12 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.js";
|
2 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
3 |
+
export declare class TimestampMillisecondsParser extends Parser<number> {
|
4 |
+
priority: number;
|
5 |
+
parse(dateString: string): ParseResult<number>;
|
6 |
+
set<DateType extends Date>(
|
7 |
+
date: DateType,
|
8 |
+
_flags: ParseFlags,
|
9 |
+
value: number,
|
10 |
+
): [DateType, ParseFlags];
|
11 |
+
incompatibleTokens: "*";
|
12 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.TimestampMillisecondsParser = void 0;
|
3 |
+
var _index = require("../../../constructFrom.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class TimestampMillisecondsParser extends _Parser.Parser {
|
9 |
+
priority = 20;
|
10 |
+
|
11 |
+
parse(dateString) {
|
12 |
+
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
13 |
+
}
|
14 |
+
|
15 |
+
set(date, _flags, value) {
|
16 |
+
return [(0, _index.constructFrom)(date, value), { timestampIsSet: true }];
|
17 |
+
}
|
18 |
+
|
19 |
+
incompatibleTokens = "*";
|
20 |
+
}
|
21 |
+
exports.TimestampMillisecondsParser = TimestampMillisecondsParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "../../../constructFrom.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { parseAnyDigitsSigned } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class TimestampMillisecondsParser extends Parser {
|
6 |
+
priority = 20;
|
7 |
+
|
8 |
+
parse(dateString) {
|
9 |
+
return parseAnyDigitsSigned(dateString);
|
10 |
+
}
|
11 |
+
|
12 |
+
set(date, _flags, value) {
|
13 |
+
return [constructFrom(date, value), { timestampIsSet: true }];
|
14 |
+
}
|
15 |
+
|
16 |
+
incompatibleTokens = "*";
|
17 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.d.mts
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.js";
|
2 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
3 |
+
export declare class TimestampSecondsParser extends Parser<number> {
|
4 |
+
priority: number;
|
5 |
+
parse(dateString: string): ParseResult<number>;
|
6 |
+
set<DateType extends Date>(
|
7 |
+
date: DateType,
|
8 |
+
_flags: ParseFlags,
|
9 |
+
value: number,
|
10 |
+
): [DateType, ParseFlags];
|
11 |
+
incompatibleTokens: "*";
|
12 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.js";
|
2 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
3 |
+
export declare class TimestampSecondsParser extends Parser<number> {
|
4 |
+
priority: number;
|
5 |
+
parse(dateString: string): ParseResult<number>;
|
6 |
+
set<DateType extends Date>(
|
7 |
+
date: DateType,
|
8 |
+
_flags: ParseFlags,
|
9 |
+
value: number,
|
10 |
+
): [DateType, ParseFlags];
|
11 |
+
incompatibleTokens: "*";
|
12 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.TimestampSecondsParser = void 0;
|
3 |
+
var _index = require("../../../constructFrom.js");
|
4 |
+
var _Parser = require("../Parser.js");
|
5 |
+
|
6 |
+
var _utils = require("../utils.js");
|
7 |
+
|
8 |
+
class TimestampSecondsParser extends _Parser.Parser {
|
9 |
+
priority = 40;
|
10 |
+
|
11 |
+
parse(dateString) {
|
12 |
+
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
13 |
+
}
|
14 |
+
|
15 |
+
set(date, _flags, value) {
|
16 |
+
return [
|
17 |
+
(0, _index.constructFrom)(date, value * 1000),
|
18 |
+
{ timestampIsSet: true },
|
19 |
+
];
|
20 |
+
}
|
21 |
+
|
22 |
+
incompatibleTokens = "*";
|
23 |
+
}
|
24 |
+
exports.TimestampSecondsParser = TimestampSecondsParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "../../../constructFrom.mjs";
|
2 |
+
import { Parser } from "../Parser.mjs";
|
3 |
+
import { parseAnyDigitsSigned } from "../utils.mjs";
|
4 |
+
|
5 |
+
export class TimestampSecondsParser extends Parser {
|
6 |
+
priority = 40;
|
7 |
+
|
8 |
+
parse(dateString) {
|
9 |
+
return parseAnyDigitsSigned(dateString);
|
10 |
+
}
|
11 |
+
|
12 |
+
set(date, _flags, value) {
|
13 |
+
return [constructFrom(date, value * 1000), { timestampIsSet: true }];
|
14 |
+
}
|
15 |
+
|
16 |
+
incompatibleTokens = "*";
|
17 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.d.mts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export interface YearParserValue {
|
5 |
+
year: number;
|
6 |
+
isTwoDigitYear: boolean;
|
7 |
+
}
|
8 |
+
export declare class YearParser extends Parser<YearParserValue> {
|
9 |
+
priority: number;
|
10 |
+
incompatibleTokens: string[];
|
11 |
+
parse(
|
12 |
+
dateString: string,
|
13 |
+
token: string,
|
14 |
+
match: Match,
|
15 |
+
): ParseResult<YearParserValue>;
|
16 |
+
validate<DateType extends Date>(
|
17 |
+
_date: DateType,
|
18 |
+
value: YearParserValue,
|
19 |
+
): boolean;
|
20 |
+
set<DateType extends Date>(
|
21 |
+
date: DateType,
|
22 |
+
flags: ParseFlags,
|
23 |
+
value: YearParserValue,
|
24 |
+
): DateType;
|
25 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Match } from "../../../locale/types.js";
|
2 |
+
import { Parser } from "../Parser.js";
|
3 |
+
import type { ParseFlags, ParseResult } from "../types.js";
|
4 |
+
export interface YearParserValue {
|
5 |
+
year: number;
|
6 |
+
isTwoDigitYear: boolean;
|
7 |
+
}
|
8 |
+
export declare class YearParser extends Parser<YearParserValue> {
|
9 |
+
priority: number;
|
10 |
+
incompatibleTokens: string[];
|
11 |
+
parse(
|
12 |
+
dateString: string,
|
13 |
+
token: string,
|
14 |
+
match: Match,
|
15 |
+
): ParseResult<YearParserValue>;
|
16 |
+
validate<DateType extends Date>(
|
17 |
+
_date: DateType,
|
18 |
+
value: YearParserValue,
|
19 |
+
): boolean;
|
20 |
+
set<DateType extends Date>(
|
21 |
+
date: DateType,
|
22 |
+
flags: ParseFlags,
|
23 |
+
value: YearParserValue,
|
24 |
+
): DateType;
|
25 |
+
}
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.js
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.YearParser = void 0;
|
3 |
+
var _Parser = require("../Parser.js");
|
4 |
+
|
5 |
+
var _utils = require("../utils.js");
|
6 |
+
|
7 |
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
8 |
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
9 |
+
// |----------|-------|----|-------|-------|-------|
|
10 |
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
11 |
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
12 |
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
13 |
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
14 |
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
15 |
+
class YearParser extends _Parser.Parser {
|
16 |
+
priority = 130;
|
17 |
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
18 |
+
|
19 |
+
parse(dateString, token, match) {
|
20 |
+
const valueCallback = (year) => ({
|
21 |
+
year,
|
22 |
+
isTwoDigitYear: token === "yy",
|
23 |
+
});
|
24 |
+
|
25 |
+
switch (token) {
|
26 |
+
case "y":
|
27 |
+
return (0, _utils.mapValue)(
|
28 |
+
(0, _utils.parseNDigits)(4, dateString),
|
29 |
+
valueCallback,
|
30 |
+
);
|
31 |
+
case "yo":
|
32 |
+
return (0, _utils.mapValue)(
|
33 |
+
match.ordinalNumber(dateString, {
|
34 |
+
unit: "year",
|
35 |
+
}),
|
36 |
+
valueCallback,
|
37 |
+
);
|
38 |
+
default:
|
39 |
+
return (0, _utils.mapValue)(
|
40 |
+
(0, _utils.parseNDigits)(token.length, dateString),
|
41 |
+
valueCallback,
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
validate(_date, value) {
|
47 |
+
return value.isTwoDigitYear || value.year > 0;
|
48 |
+
}
|
49 |
+
|
50 |
+
set(date, flags, value) {
|
51 |
+
const currentYear = date.getFullYear();
|
52 |
+
|
53 |
+
if (value.isTwoDigitYear) {
|
54 |
+
const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(
|
55 |
+
value.year,
|
56 |
+
currentYear,
|
57 |
+
);
|
58 |
+
date.setFullYear(normalizedTwoDigitYear, 0, 1);
|
59 |
+
date.setHours(0, 0, 0, 0);
|
60 |
+
return date;
|
61 |
+
}
|
62 |
+
|
63 |
+
const year =
|
64 |
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
65 |
+
date.setFullYear(year, 0, 1);
|
66 |
+
date.setHours(0, 0, 0, 0);
|
67 |
+
return date;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
exports.YearParser = YearParser;
|
workers1/auto3d/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Parser } from "../Parser.mjs";
|
2 |
+
import { mapValue, normalizeTwoDigitYear, parseNDigits } from "../utils.mjs";
|
3 |
+
|
4 |
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
5 |
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
6 |
+
// |----------|-------|----|-------|-------|-------|
|
7 |
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
8 |
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
9 |
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
10 |
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
11 |
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
12 |
+
export class YearParser extends Parser {
|
13 |
+
priority = 130;
|
14 |
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
15 |
+
|
16 |
+
parse(dateString, token, match) {
|
17 |
+
const valueCallback = (year) => ({
|
18 |
+
year,
|
19 |
+
isTwoDigitYear: token === "yy",
|
20 |
+
});
|
21 |
+
|
22 |
+
switch (token) {
|
23 |
+
case "y":
|
24 |
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
25 |
+
case "yo":
|
26 |
+
return mapValue(
|
27 |
+
match.ordinalNumber(dateString, {
|
28 |
+
unit: "year",
|
29 |
+
}),
|
30 |
+
valueCallback,
|
31 |
+
);
|
32 |
+
default:
|
33 |
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
validate(_date, value) {
|
38 |
+
return value.isTwoDigitYear || value.year > 0;
|
39 |
+
}
|
40 |
+
|
41 |
+
set(date, flags, value) {
|
42 |
+
const currentYear = date.getFullYear();
|
43 |
+
|
44 |
+
if (value.isTwoDigitYear) {
|
45 |
+
const normalizedTwoDigitYear = normalizeTwoDigitYear(
|
46 |
+
value.year,
|
47 |
+
currentYear,
|
48 |
+
);
|
49 |
+
date.setFullYear(normalizedTwoDigitYear, 0, 1);
|
50 |
+
date.setHours(0, 0, 0, 0);
|
51 |
+
return date;
|
52 |
+
}
|
53 |
+
|
54 |
+
const year =
|
55 |
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
56 |
+
date.setFullYear(year, 0, 1);
|
57 |
+
date.setHours(0, 0, 0, 0);
|
58 |
+
return date;
|
59 |
+
}
|
60 |
+
}
|