@checkdigit/time 5.0.0-PR.21-2767 → 5.0.0-PR.21-cb18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-mjs/date-fns/_lib/getRoundingMethod/index.mjs +1 -1
- package/dist-mjs/date-fns/_lib/protectedTokens/index.mjs +1 -1
- package/dist-mjs/date-fns/constants/index.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/Setter.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/constants.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/AMPMParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/DateParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/DayOfYearParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/DayParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/DayPeriodParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/EraParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ISODayParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ISOWeekParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/LocalDayParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/LocalWeekParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/MinuteParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/MonthParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/QuarterParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/SecondParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs +1 -1
- package/dist-mjs/date-fns/parse/_lib/parsers/YearParser.mjs +1 -1
- package/dist-mjs/date-fns/types.mjs +1 -3
- package/dist-mjs/date-fns-tz/_lib/tzPattern/index.mjs +1 -1
- package/dist-mjs/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.mjs +2 -2
- package/dist-mjs/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.mjs +24 -24
- package/dist-mjs/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.mjs +2 -2
- package/dist-types/date-fns/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/date-fns/_lib/getRoundingMethod/index.ts +1 -1
- package/src/date-fns/_lib/protectedTokens/index.ts +2 -2
- package/src/date-fns/constants/index.ts +8 -8
- package/src/date-fns/parse/_lib/Setter.ts +1 -1
- package/src/date-fns/parse/_lib/constants.ts +28 -2
- package/src/date-fns/parse/_lib/parsers/AMPMMidnightParser.ts +1 -2
- package/src/date-fns/parse/_lib/parsers/AMPMParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/DateParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/DayOfYearParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/DayParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/DayPeriodParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/EraParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ExtendedYearParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/FractionOfSecondParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/Hour0To11Parser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/Hour0to23Parser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/Hour1To24Parser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/Hour1to12Parser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ISODayParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ISOTimezoneParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ISOWeekParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/ISOWeekYearParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/LocalDayParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/LocalWeekParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/LocalWeekYearParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/MinuteParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/MonthParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/QuarterParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/SecondParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/StandAloneMonthParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/StandAloneQuarterParser.ts +1 -1
- package/src/date-fns/parse/_lib/parsers/YearParser.ts +1 -1
- package/src/date-fns/types.ts +1 -1
- package/src/date-fns-tz/_lib/tzPattern/index.ts +1 -1
- package/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts +1 -1
- package/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts +23 -23
- package/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts +1 -1
package/dist-mjs/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { getAllUSFederalReserveBankHolidays } from "./index.mjs";
|
|
|
4
4
|
var DAY_OF_THE_WEEK_SUNDAY = 0;
|
|
5
5
|
var DAY_OF_THE_WEEK_SATURDAY = 6;
|
|
6
6
|
function is_us_federal_reserve_bank_closed_default(plainDate) {
|
|
7
|
-
const date = new Date(plainDate.year, plainDate.month, plainDate.date);
|
|
7
|
+
const date = new Date(Date.UTC(plainDate.year, plainDate.month, plainDate.date));
|
|
8
8
|
const year = date.getUTCFullYear();
|
|
9
9
|
const day = date.getUTCDay();
|
|
10
10
|
const formattedDate = formatUtc(date, "yyyy-MM-dd");
|
|
@@ -16,4 +16,4 @@ function is_us_federal_reserve_bank_closed_default(plainDate) {
|
|
|
16
16
|
export {
|
|
17
17
|
is_us_federal_reserve_bank_closed_default as default
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2hvbGlkYXlzL3VuaXRlZC1zdGF0ZXMvZmVkZXJhbC1yZXNlcnZlLWJhbmsvaXMtdXMtZmVkZXJhbC1yZXNlcnZlLWJhbmstY2xvc2VkLnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQUVBLFNBQVMsaUJBQWlCO0FBRTFCLFNBQVMsMENBQTBEO0FBRW5FLElBQU0seUJBQXlCO0FBQy9CLElBQU0sMkJBQTJCO0FBY2xCLFNBQVIsMENBQWtCLFdBQStCO0FBQ3RELFFBQU0sT0FBTyxJQUFJLEtBQUssS0FBSyxJQUFJLFVBQVUsTUFBTSxVQUFVLE9BQU8sVUFBVSxJQUFJLENBQUM7QUFDL0UsUUFBTSxPQUFPLEtBQUssZUFBZTtBQUNqQyxRQUFNLE1BQU0sS0FBSyxVQUFVO0FBQzNCLFFBQU0sZ0JBQWdCLFVBQVUsTUFBTSxZQUFZO0FBQ2xELFFBQU0sa0NBQWtDLG1DQUFtQyxJQUFJO0FBRS9FLFNBQ0UsUUFBUSw0QkFDUixRQUFRLDBCQUNSLGdDQUFnQztBQUFBLElBQzlCLENBQUMsWUFBWSxRQUFRLFNBQVMsaUJBQWlCLFFBQVEsZUFBZTtBQUFBLEVBQ3hFO0FBRUo7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@checkdigit/time","version":"5.0.0-PR.21-
|
|
1
|
+
{"name":"@checkdigit/time","version":"5.0.0-PR.21-cb18","description":"Standard time handling","homepage":"https://github.com/checkdigit/time#readme","bugs":{"url":"https://github.com/checkdigit/time/issues"},"repository":{"type":"git","url":"git+https://github.com/checkdigit/time.git"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"rimraf coverage && mkdir coverage && node --experimental-strip-types --test-timeout 600000 --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test \"src/**/*.spec.ts\"","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"node --env-file=.env --disable-warning ExperimentalWarning --experimental-strip-types --test-timeout 600000 --test \"src/**/*.spec.ts\"","lint":"eslint --max-warnings 0 .","lint:fix":"eslint . --fix","prepublishOnly":"npm run build:dist-types && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","devDependencies":{"@checkdigit/eslint-config":"^11.2.0","@checkdigit/prettier-config":"^6.3.0","@checkdigit/typescript-config":"^9.1.0","rimraf":"^6.0.1"},"engines":{"node":">=22.11"}}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { RoundingMethod } from '../../types.ts';
|
|
6
6
|
|
|
7
7
|
export function getRoundingMethod(method: RoundingMethod | undefined) {
|
|
8
|
-
return (number: number) => {
|
|
8
|
+
return (number: number): number => {
|
|
9
9
|
const round = method ? Math[method] : Math.trunc;
|
|
10
10
|
const result = round(number);
|
|
11
11
|
// Prevent negative zero
|
|
@@ -7,11 +7,11 @@ const weekYearTokenRE = /^Y+$/;
|
|
|
7
7
|
|
|
8
8
|
const throwTokens = ['D', 'DD', 'YY', 'YYYY'];
|
|
9
9
|
|
|
10
|
-
export function isProtectedDayOfYearToken(token: string) {
|
|
10
|
+
export function isProtectedDayOfYearToken(token: string): boolean {
|
|
11
11
|
return dayOfYearTokenRE.test(token);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function isProtectedWeekYearToken(token: string) {
|
|
14
|
+
export function isProtectedWeekYearToken(token: string): boolean {
|
|
15
15
|
return weekYearTokenRE.test(token);
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -55,7 +55,7 @@ export const daysInYear = 365.2425;
|
|
|
55
55
|
* new Date(8640000000000001);
|
|
56
56
|
* //=> Invalid Date
|
|
57
57
|
*/
|
|
58
|
-
export const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
|
|
58
|
+
export const maxTime: number = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* @constant
|
|
@@ -71,7 +71,7 @@ export const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
|
|
|
71
71
|
* new Date(-8640000000000001)
|
|
72
72
|
* //=> Invalid Date
|
|
73
73
|
*/
|
|
74
|
-
export const minTime = -maxTime;
|
|
74
|
+
export const minTime: number = -maxTime;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @constant
|
|
@@ -176,35 +176,35 @@ export const secondsInMinute = 60;
|
|
|
176
176
|
* @name secondsInDay
|
|
177
177
|
* @summary Seconds in 1 day.
|
|
178
178
|
*/
|
|
179
|
-
export const secondsInDay = secondsInHour * 24;
|
|
179
|
+
export const secondsInDay: number = secondsInHour * 24;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
182
|
* @constant
|
|
183
183
|
* @name secondsInWeek
|
|
184
184
|
* @summary Seconds in 1 week.
|
|
185
185
|
*/
|
|
186
|
-
export const secondsInWeek = secondsInDay * 7;
|
|
186
|
+
export const secondsInWeek: number = secondsInDay * 7;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* @constant
|
|
190
190
|
* @name secondsInYear
|
|
191
191
|
* @summary Seconds in 1 year.
|
|
192
192
|
*/
|
|
193
|
-
export const secondsInYear = secondsInDay * daysInYear;
|
|
193
|
+
export const secondsInYear: number = secondsInDay * daysInYear;
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* @constant
|
|
197
197
|
* @name secondsInMonth
|
|
198
198
|
* @summary Seconds in 1 month
|
|
199
199
|
*/
|
|
200
|
-
export const secondsInMonth = secondsInYear / 12;
|
|
200
|
+
export const secondsInMonth: number = secondsInYear / 12;
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
203
|
* @constant
|
|
204
204
|
* @name secondsInQuarter
|
|
205
205
|
* @summary Seconds in 1 quarter.
|
|
206
206
|
*/
|
|
207
|
-
export const secondsInQuarter = secondsInMonth * 3;
|
|
207
|
+
export const secondsInQuarter: number = secondsInMonth * 3;
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* @constant
|
|
@@ -217,6 +217,6 @@ export const secondsInQuarter = secondsInMonth * 3;
|
|
|
217
217
|
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
|
|
218
218
|
* a constructor argument.
|
|
219
219
|
*/
|
|
220
|
-
export const constructFromSymbol = Symbol.for('constructDateFrom');
|
|
220
|
+
export const constructFromSymbol: unique symbol = Symbol.for('constructDateFrom');
|
|
221
221
|
|
|
222
222
|
/* eslint-enable */
|
|
@@ -2,7 +2,27 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
|
|
5
|
-
export const numericPatterns
|
|
5
|
+
export const numericPatterns: {
|
|
6
|
+
month: RegExp; // 0 to 12
|
|
7
|
+
date: RegExp; // 0 to 31
|
|
8
|
+
dayOfYear: RegExp; // 0 to 366
|
|
9
|
+
week: RegExp; // 0 to 53
|
|
10
|
+
hour23h: RegExp; // 0 to 23
|
|
11
|
+
hour24h: RegExp; // 0 to 24
|
|
12
|
+
hour11h: RegExp; // 0 to 11
|
|
13
|
+
hour12h: RegExp; // 0 to 12
|
|
14
|
+
minute: RegExp; // 0 to 59
|
|
15
|
+
second: RegExp; // 0 to 59
|
|
16
|
+
singleDigit: RegExp; // 0 to 9
|
|
17
|
+
twoDigits: RegExp; // 0 to 99
|
|
18
|
+
threeDigits: RegExp; // 0 to 999
|
|
19
|
+
fourDigits: RegExp; // 0 to 9999
|
|
20
|
+
anyDigitsSigned: RegExp;
|
|
21
|
+
singleDigitSigned: RegExp; // 0 to 9, -0 to -9
|
|
22
|
+
twoDigitsSigned: RegExp; // 0 to 99, -0 to -99
|
|
23
|
+
threeDigitsSigned: RegExp; // 0 to 999, -0 to -999
|
|
24
|
+
fourDigitsSigned: RegExp;
|
|
25
|
+
} = {
|
|
6
26
|
month: /^(1[0-2]|0?\d)/, // 0 to 12
|
|
7
27
|
date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31
|
|
8
28
|
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366
|
|
@@ -26,7 +46,13 @@ export const numericPatterns = {
|
|
|
26
46
|
fourDigitsSigned: /^-?\d{1,4}/, // 0 to 9999, -0 to -9999
|
|
27
47
|
};
|
|
28
48
|
|
|
29
|
-
export const timezonePatterns
|
|
49
|
+
export const timezonePatterns: {
|
|
50
|
+
basicOptionalMinutes: RegExp;
|
|
51
|
+
basic: RegExp;
|
|
52
|
+
basicOptionalSeconds: RegExp;
|
|
53
|
+
extended: RegExp;
|
|
54
|
+
extendedOptionalSeconds: RegExp;
|
|
55
|
+
} = {
|
|
30
56
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
31
57
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
32
58
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable eslint-comments/no-unlimited-disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
|
|
5
4
|
import type { LocaleDayPeriod, Match } from '../../../locale/types.ts';
|
|
6
5
|
import { Parser } from '../Parser.ts';
|
|
@@ -54,7 +53,7 @@ export class AMPMMidnightParser extends Parser<LocaleDayPeriod> {
|
|
|
54
53
|
return date;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
incompatibleTokens = ['a', 'B', 'H', 'k', 't', 'T'];
|
|
56
|
+
incompatibleTokens: string[] = ['a', 'B', 'H', 'k', 't', 'T'];
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
/* eslint-enable */
|
|
@@ -44,7 +44,7 @@ export class DateParser extends Parser<number> {
|
|
|
44
44
|
return date;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
incompatibleTokens = ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
47
|
+
incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/* eslint-enable */
|
|
@@ -41,7 +41,7 @@ export class DayOfYearParser extends Parser<number> {
|
|
|
41
41
|
return date;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
incompatibleTokens = ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T'];
|
|
44
|
+
incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T'];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/* eslint-enable */
|
|
@@ -23,7 +23,7 @@ export class ExtendedYearParser extends Parser<number> {
|
|
|
23
23
|
return date;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
incompatibleTokens = ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T'];
|
|
26
|
+
incompatibleTokens: string[] = ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T'];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/* eslint-enable */
|
|
@@ -102,7 +102,7 @@ export class ISODayParser extends Parser<number> {
|
|
|
102
102
|
return date;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
incompatibleTokens = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T'];
|
|
105
|
+
incompatibleTokens: string[] = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T'];
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/* eslint-enable */
|
|
@@ -34,7 +34,7 @@ export class ISOTimezoneParser extends Parser<number> {
|
|
|
34
34
|
return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
incompatibleTokens = ['t', 'T', 'X'];
|
|
37
|
+
incompatibleTokens: string[] = ['t', 'T', 'X'];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/* eslint-enable */
|
|
@@ -34,7 +34,7 @@ export class ISOTimezoneWithZParser extends Parser<number> {
|
|
|
34
34
|
return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
incompatibleTokens = ['t', 'T', 'x'];
|
|
37
|
+
incompatibleTokens: string[] = ['t', 'T', 'x'];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/* eslint-enable */
|
|
@@ -33,7 +33,7 @@ export class ISOWeekParser extends Parser<number> {
|
|
|
33
33
|
return startOfISOWeek(setISOWeek(date, value));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
incompatibleTokens = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'];
|
|
36
|
+
incompatibleTokens: string[] = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/* eslint-enable */
|
|
@@ -27,7 +27,7 @@ export class ISOWeekYearParser extends Parser<number> {
|
|
|
27
27
|
return startOfISOWeek(firstWeekOfYear);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
incompatibleTokens = ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'];
|
|
30
|
+
incompatibleTokens: string[] = ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'];
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/* eslint-enable */
|
|
@@ -78,7 +78,7 @@ export class LocalDayParser extends Parser<number> {
|
|
|
78
78
|
return date;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T'];
|
|
81
|
+
incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T'];
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/* eslint-enable */
|
|
@@ -33,7 +33,7 @@ export class LocalWeekParser extends Parser<number> {
|
|
|
33
33
|
return startOfWeek(setWeek(date, value, options), options);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'];
|
|
36
|
+
incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/* eslint-enable */
|
|
@@ -60,7 +60,7 @@ export class LocalWeekYearParser extends Parser<YearParserValue> {
|
|
|
60
60
|
return startOfWeek(date, options);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
incompatibleTokens = ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'];
|
|
63
|
+
incompatibleTokens: string[] = ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'];
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* eslint-enable */
|
|
@@ -9,7 +9,7 @@ import type { ParseFlags, ParseResult } from '../types.ts';
|
|
|
9
9
|
import { mapValue, parseNDigits, parseNumericPattern } from '../utils.ts';
|
|
10
10
|
|
|
11
11
|
export class MonthParser extends Parser<number> {
|
|
12
|
-
incompatibleTokens = ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
12
|
+
incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
13
13
|
priority = 110;
|
|
14
14
|
|
|
15
15
|
parse(dateString: string, token: string, match: Match): ParseResult<number> {
|
|
@@ -67,7 +67,7 @@ export class QuarterParser extends Parser<number> {
|
|
|
67
67
|
return date;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
incompatibleTokens = ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
70
|
+
incompatibleTokens: string[] = ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/* eslint-enable */
|
|
@@ -79,7 +79,7 @@ export class StandAloneLocalDayParser extends Parser<number> {
|
|
|
79
79
|
return date;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T'];
|
|
82
|
+
incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T'];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/* eslint-enable */
|
|
@@ -67,7 +67,7 @@ export class StandAloneMonthParser extends Parser<number> {
|
|
|
67
67
|
return date;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
incompatibleTokens = ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
70
|
+
incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/* eslint-enable */
|
|
@@ -67,7 +67,7 @@ export class StandAloneQuarterParser extends Parser<number> {
|
|
|
67
67
|
return date;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
incompatibleTokens = ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
70
|
+
incompatibleTokens: string[] = ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/* eslint-enable */
|
|
@@ -22,7 +22,7 @@ export interface YearParserValue {
|
|
|
22
22
|
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
23
23
|
export class YearParser extends Parser<YearParserValue> {
|
|
24
24
|
priority = 130;
|
|
25
|
-
incompatibleTokens = ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T'];
|
|
25
|
+
incompatibleTokens: string[] = ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T'];
|
|
26
26
|
|
|
27
27
|
parse(dateString: string, token: string, match: Match): ParseResult<YearParserValue> {
|
|
28
28
|
const valueCallback = (year: number) => ({
|
package/src/date-fns/types.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
|
|
5
5
|
/** Regex to identify the presence of a time zone specifier in a date string */
|
|
6
|
-
export const tzPattern = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
|
|
6
|
+
export const tzPattern: RegExp = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
|
|
7
7
|
|
|
8
8
|
/* eslint-enable */
|
package/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default function (plainDate: PlainDate, amount: number): PlainDate {
|
|
|
19
19
|
throw new TypeError('Invalid Amount');
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const result = new Date(plainDate.year, plainDate.month, plainDate.date);
|
|
22
|
+
const result = new Date(Date.UTC(plainDate.year, plainDate.month, plainDate.date));
|
|
23
23
|
result.setUTCHours(0, 0, 0, 0);
|
|
24
24
|
|
|
25
25
|
let count = 0;
|