@sprucelabs/calendar-utils 31.3.0 → 31.3.2
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/build/esm/parsing/DateParser.d.ts +1 -0
- package/build/esm/parsing/DateParser.js +1 -0
- package/build/esm/parsing/strategies/TimeParser.js +1 -1
- package/build/parsing/DateParser.d.ts +1 -0
- package/build/parsing/DateParser.js +1 -0
- package/build/parsing/strategies/TimeParser.js +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { Locale } from '../types/calendar.types';
|
|
|
2
2
|
export default class DateParser {
|
|
3
3
|
private now;
|
|
4
4
|
private parsers;
|
|
5
|
+
protected locale: Locale;
|
|
5
6
|
private constructor();
|
|
6
7
|
static Parser(now: () => number, locale: Locale): DateParser;
|
|
7
8
|
parse(str: string): number | null;
|
|
@@ -9,7 +9,7 @@ export default class TimeParser extends AbstractParser {
|
|
|
9
9
|
}
|
|
10
10
|
if (match) {
|
|
11
11
|
date.hour =
|
|
12
|
-
parseInt(match, 10)
|
|
12
|
+
parseInt(match, 10) - this.locale.getTimezoneOffsetMinutes() / 60;
|
|
13
13
|
date.minute = 0;
|
|
14
14
|
str = str.replace(match, '');
|
|
15
15
|
}
|
|
@@ -2,6 +2,7 @@ import { Locale } from '../types/calendar.types';
|
|
|
2
2
|
export default class DateParser {
|
|
3
3
|
private now;
|
|
4
4
|
private parsers;
|
|
5
|
+
protected locale: Locale;
|
|
5
6
|
private constructor();
|
|
6
7
|
static Parser(now: () => number, locale: Locale): DateParser;
|
|
7
8
|
parse(str: string): number | null;
|
|
@@ -14,7 +14,7 @@ class TimeParser extends AbstractParser_1.AbstractParser {
|
|
|
14
14
|
}
|
|
15
15
|
if (match) {
|
|
16
16
|
date.hour =
|
|
17
|
-
parseInt(match, 10)
|
|
17
|
+
parseInt(match, 10) - this.locale.getTimezoneOffsetMinutes() / 60;
|
|
18
18
|
date.minute = 0;
|
|
19
19
|
str = str.replace(match, '');
|
|
20
20
|
}
|