@finnair/v-validation-luxon 1.1.0-alpha.5 → 1.1.0-alpha.6
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/CHANGELOG.md +17 -0
- package/dist/Vluxon.d.ts +3 -3
- package/dist/Vluxon.js +11 -7
- package/dist/luxon.d.ts +15 -13
- package/dist/luxon.js +36 -30
- package/dist/test-luxon.js +2 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.1.0-alpha.6](https://github.com/finnair/v-validation/compare/v1.0.1...v1.1.0-alpha.6) (2022-08-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Fix exports ([b9eacb6](https://github.com/finnair/v-validation/commit/b9eacb6e98a05a07049eb0a8f97b7e6b4958973a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* fromISO helper for Luxon wrapper construction ([e3b8f24](https://github.com/finnair/v-validation/commit/e3b8f247b3a9bfef8ad474688f995862fdd810e3))
|
|
17
|
+
* Support for Luxon ([00d0a8e](https://github.com/finnair/v-validation/commit/00d0a8e8c8de46bfeb3502f51bb8cd5a3627070e))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [1.1.0-alpha.5](https://github.com/finnair/v-validation/compare/v1.0.1...v1.1.0-alpha.5) (2022-08-16)
|
|
7
24
|
|
|
8
25
|
|
package/dist/Vluxon.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationContext, Validator, ValidationResult } from '@finnair/v-validation';
|
|
2
2
|
import { Path } from '@finnair/path';
|
|
3
|
-
import { DateTime,
|
|
3
|
+
import { DateTime, DateTimeOptions } from 'luxon';
|
|
4
4
|
import { LuxonDateTime } from './luxon';
|
|
5
5
|
export declare type LuxonInput = string | DateTime | LuxonDateTime;
|
|
6
6
|
export interface ValidateLuxonParams {
|
|
@@ -10,9 +10,9 @@ export interface ValidateLuxonParams {
|
|
|
10
10
|
type: string;
|
|
11
11
|
proto: any;
|
|
12
12
|
pattern: RegExp;
|
|
13
|
-
|
|
13
|
+
options: DateTimeOptions;
|
|
14
14
|
}
|
|
15
|
-
export declare function validateLuxon({ value, path, ctx, type, proto, pattern,
|
|
15
|
+
export declare function validateLuxon({ value, path, ctx, type, proto, pattern, options }: ValidateLuxonParams): ValidationResult;
|
|
16
16
|
export declare class DurationValidator extends Validator {
|
|
17
17
|
validatePath(value: any, path: Path, ctx: ValidationContext): Promise<ValidationResult>;
|
|
18
18
|
}
|
package/dist/Vluxon.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.Vluxon = exports.DurationValidator = exports.validateLuxon = void 0;
|
|
|
13
13
|
const v_validation_1 = require("@finnair/v-validation");
|
|
14
14
|
const luxon_1 = require("luxon");
|
|
15
15
|
const luxon_2 = require("./luxon");
|
|
16
|
-
function validateLuxon({ value, path, ctx, type, proto, pattern,
|
|
16
|
+
function validateLuxon({ value, path, ctx, type, proto, pattern, options }) {
|
|
17
17
|
if ((0, v_validation_1.isNullOrUndefined)(value)) {
|
|
18
18
|
return ctx.failure(v_validation_1.defaultViolations.notNull(path), value);
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ function validateLuxon({ value, path, ctx, type, proto, pattern, defaultZone })
|
|
|
27
27
|
}
|
|
28
28
|
else if ((0, v_validation_1.isString)(value)) {
|
|
29
29
|
if (pattern.test(value)) {
|
|
30
|
-
const dateTime = luxon_1.DateTime.fromISO(value,
|
|
30
|
+
const dateTime = luxon_1.DateTime.fromISO(value, options);
|
|
31
31
|
if (dateTime.isValid) {
|
|
32
32
|
return ctx.success(new proto(dateTime));
|
|
33
33
|
}
|
|
@@ -46,7 +46,7 @@ function localDateValidator(value, path, ctx) {
|
|
|
46
46
|
type: 'Date',
|
|
47
47
|
proto: luxon_2.LocalDateLuxon,
|
|
48
48
|
pattern: datePattern,
|
|
49
|
-
|
|
49
|
+
options: { zone: luxon_1.FixedOffsetZone.utcInstance },
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -60,7 +60,7 @@ function localTimeValidator(value, path, ctx) {
|
|
|
60
60
|
type: 'Time',
|
|
61
61
|
proto: luxon_2.LocalTimeLuxon,
|
|
62
62
|
pattern: timePattern,
|
|
63
|
-
|
|
63
|
+
options: { zone: luxon_1.FixedOffsetZone.utcInstance },
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -74,6 +74,7 @@ function dateTimeValidator(value, path, ctx) {
|
|
|
74
74
|
type: 'DateTime',
|
|
75
75
|
proto: luxon_2.DateTimeLuxon,
|
|
76
76
|
pattern: dateTimePattern,
|
|
77
|
+
options: { setZone: true },
|
|
77
78
|
});
|
|
78
79
|
});
|
|
79
80
|
}
|
|
@@ -85,7 +86,8 @@ function dateTimeUtcValidator(value, path, ctx) {
|
|
|
85
86
|
ctx,
|
|
86
87
|
type: 'DateTime',
|
|
87
88
|
proto: luxon_2.DateTimeUtcLuxon,
|
|
88
|
-
pattern: dateTimePattern
|
|
89
|
+
pattern: dateTimePattern,
|
|
90
|
+
options: { zone: luxon_1.FixedOffsetZone.utcInstance },
|
|
89
91
|
});
|
|
90
92
|
});
|
|
91
93
|
}
|
|
@@ -98,7 +100,8 @@ function dateTimeMillisValidator(value, path, ctx) {
|
|
|
98
100
|
ctx,
|
|
99
101
|
type: 'DateTimeMillis',
|
|
100
102
|
proto: luxon_2.DateTimeMillisLuxon,
|
|
101
|
-
pattern: dateTimeMillisPattern
|
|
103
|
+
pattern: dateTimeMillisPattern,
|
|
104
|
+
options: { setZone: true },
|
|
102
105
|
});
|
|
103
106
|
});
|
|
104
107
|
}
|
|
@@ -110,7 +113,8 @@ function dateTimeMillisUtcValidator(value, path, ctx) {
|
|
|
110
113
|
ctx,
|
|
111
114
|
type: 'DateTimeMillis',
|
|
112
115
|
proto: luxon_2.DateTimeMillisUtcLuxon,
|
|
113
|
-
pattern: dateTimeMillisPattern
|
|
116
|
+
pattern: dateTimeMillisPattern,
|
|
117
|
+
options: { zone: luxon_1.FixedOffsetZone.utcInstance },
|
|
114
118
|
});
|
|
115
119
|
});
|
|
116
120
|
}
|
package/dist/luxon.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTime, DateTimeOptions } from 'luxon';
|
|
1
|
+
import { DateTime, DateTimeJSOptions, DateTimeOptions } from 'luxon';
|
|
2
2
|
export declare type LuxonDateTimeInput = DateTime | LuxonDateTime;
|
|
3
3
|
export declare abstract class LuxonDateTime {
|
|
4
4
|
readonly dateTime: DateTime;
|
|
@@ -16,10 +16,11 @@ export declare abstract class LuxonDateTime {
|
|
|
16
16
|
export declare class LocalDateLuxon extends LuxonDateTime {
|
|
17
17
|
static readonly format = "yyyy-MM-dd";
|
|
18
18
|
constructor(input: LuxonDateTimeInput);
|
|
19
|
-
static
|
|
19
|
+
static nowLocal(options?: DateTimeJSOptions): LocalDateLuxon;
|
|
20
|
+
static nowUtc(): LocalDateLuxon;
|
|
20
21
|
static fromISO(value: string, options?: DateTimeOptions): LocalDateLuxon;
|
|
21
22
|
static fromJSDate(date: Date, options?: DateTimeOptions): LocalDateLuxon;
|
|
22
|
-
static fromMillis(
|
|
23
|
+
static fromMillis(millis: number, options?: DateTimeOptions): LocalDateLuxon;
|
|
23
24
|
protected normalize(dateTime: DateTime): DateTime;
|
|
24
25
|
wrap(fn: (dateTime: DateTime) => DateTime): LocalDateLuxon;
|
|
25
26
|
toJSON(): string;
|
|
@@ -27,10 +28,11 @@ export declare class LocalDateLuxon extends LuxonDateTime {
|
|
|
27
28
|
export declare class LocalTimeLuxon extends LuxonDateTime {
|
|
28
29
|
static readonly format = "HH:mm:ss";
|
|
29
30
|
constructor(input: LuxonDateTimeInput);
|
|
30
|
-
static
|
|
31
|
+
static nowLocal(options?: DateTimeJSOptions): LocalTimeLuxon;
|
|
32
|
+
static nowUtc(): LocalTimeLuxon;
|
|
31
33
|
static fromISO(value: string, options?: DateTimeOptions): LocalTimeLuxon;
|
|
32
34
|
static fromJSDate(date: Date, options?: DateTimeOptions): LocalTimeLuxon;
|
|
33
|
-
static fromMillis(
|
|
35
|
+
static fromMillis(millis: number, options?: DateTimeOptions): LocalTimeLuxon;
|
|
34
36
|
protected normalize(dateTime: DateTime): DateTime;
|
|
35
37
|
wrap(fn: (dateTime: DateTime) => DateTime): LocalTimeLuxon;
|
|
36
38
|
toJSON(): string;
|
|
@@ -39,10 +41,10 @@ export declare class DateTimeLuxon extends LuxonDateTime {
|
|
|
39
41
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss";
|
|
40
42
|
static readonly formatTz: string;
|
|
41
43
|
constructor(input: LuxonDateTimeInput);
|
|
42
|
-
static now(): DateTimeLuxon;
|
|
44
|
+
static now(options?: DateTimeJSOptions): DateTimeLuxon;
|
|
43
45
|
static fromISO(value: string, options?: DateTimeOptions): DateTimeLuxon;
|
|
44
46
|
static fromJSDate(date: Date, options?: DateTimeOptions): DateTimeLuxon;
|
|
45
|
-
static fromMillis(
|
|
47
|
+
static fromMillis(millis: number, options?: DateTimeOptions): DateTimeLuxon;
|
|
46
48
|
protected normalize(dateTime: DateTime): DateTime;
|
|
47
49
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeLuxon;
|
|
48
50
|
toJSON(): string;
|
|
@@ -50,9 +52,9 @@ export declare class DateTimeLuxon extends LuxonDateTime {
|
|
|
50
52
|
export declare class DateTimeUtcLuxon extends LuxonDateTime {
|
|
51
53
|
constructor(input: LuxonDateTimeInput);
|
|
52
54
|
static now(): DateTimeUtcLuxon;
|
|
53
|
-
static fromISO(value: string): DateTimeUtcLuxon;
|
|
55
|
+
static fromISO(value: string, options?: DateTimeOptions): DateTimeUtcLuxon;
|
|
54
56
|
static fromJSDate(date: Date, options?: DateTimeOptions): DateTimeUtcLuxon;
|
|
55
|
-
static fromMillis(
|
|
57
|
+
static fromMillis(millis: number, options?: DateTimeOptions): DateTimeUtcLuxon;
|
|
56
58
|
protected normalize(dateTime: DateTime): DateTime;
|
|
57
59
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeUtcLuxon;
|
|
58
60
|
toJSON(): string;
|
|
@@ -61,10 +63,10 @@ export declare class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
61
63
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
|
|
62
64
|
static readonly formatTz: string;
|
|
63
65
|
constructor(input: LuxonDateTimeInput);
|
|
64
|
-
static now(): DateTimeMillisLuxon;
|
|
65
|
-
static fromISO(value: string): DateTimeMillisLuxon;
|
|
66
|
+
static now(options?: DateTimeJSOptions): DateTimeMillisLuxon;
|
|
67
|
+
static fromISO(value: string, options?: DateTimeOptions): DateTimeMillisLuxon;
|
|
66
68
|
static fromJSDate(date: Date, options?: DateTimeOptions): DateTimeMillisLuxon;
|
|
67
|
-
static fromMillis(
|
|
69
|
+
static fromMillis(millis: number, options?: DateTimeOptions): DateTimeMillisLuxon;
|
|
68
70
|
protected normalize(dateTime: DateTime): DateTime;
|
|
69
71
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisLuxon;
|
|
70
72
|
toJSON(): string;
|
|
@@ -74,7 +76,7 @@ export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
74
76
|
static now(): DateTimeMillisUtcLuxon;
|
|
75
77
|
static fromISO(value: string, options?: DateTimeOptions): DateTimeMillisUtcLuxon;
|
|
76
78
|
static fromJSDate(date: Date, options?: DateTimeOptions): DateTimeMillisUtcLuxon;
|
|
77
|
-
static fromMillis(
|
|
79
|
+
static fromMillis(millis: number, options?: DateTimeOptions): DateTimeMillisUtcLuxon;
|
|
78
80
|
protected normalize(dateTime: DateTime): DateTime;
|
|
79
81
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisUtcLuxon;
|
|
80
82
|
toJSON(): string;
|
package/dist/luxon.js
CHANGED
|
@@ -36,8 +36,11 @@ class LocalDateLuxon extends LuxonDateTime {
|
|
|
36
36
|
constructor(input) {
|
|
37
37
|
super(input);
|
|
38
38
|
}
|
|
39
|
-
static
|
|
40
|
-
return new LocalDateLuxon(luxon_1.DateTime.
|
|
39
|
+
static nowLocal(options) {
|
|
40
|
+
return new LocalDateLuxon(luxon_1.DateTime.local(options));
|
|
41
|
+
}
|
|
42
|
+
static nowUtc() {
|
|
43
|
+
return new LocalDateLuxon(luxon_1.DateTime.utc());
|
|
41
44
|
}
|
|
42
45
|
static fromISO(value, options) {
|
|
43
46
|
return new LocalDateLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
@@ -45,8 +48,8 @@ class LocalDateLuxon extends LuxonDateTime {
|
|
|
45
48
|
static fromJSDate(date, options) {
|
|
46
49
|
return new LocalDateLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
47
50
|
}
|
|
48
|
-
static fromMillis(
|
|
49
|
-
return new LocalDateLuxon(luxon_1.DateTime.fromMillis(
|
|
51
|
+
static fromMillis(millis, options) {
|
|
52
|
+
return new LocalDateLuxon(luxon_1.DateTime.fromMillis(millis, options));
|
|
50
53
|
}
|
|
51
54
|
normalize(dateTime) {
|
|
52
55
|
return luxon_1.DateTime.utc(dateTime.year, dateTime.month, dateTime.day);
|
|
@@ -64,8 +67,11 @@ class LocalTimeLuxon extends LuxonDateTime {
|
|
|
64
67
|
constructor(input) {
|
|
65
68
|
super(input);
|
|
66
69
|
}
|
|
67
|
-
static
|
|
68
|
-
return new LocalTimeLuxon(luxon_1.DateTime.
|
|
70
|
+
static nowLocal(options) {
|
|
71
|
+
return new LocalTimeLuxon(luxon_1.DateTime.local(options));
|
|
72
|
+
}
|
|
73
|
+
static nowUtc() {
|
|
74
|
+
return new LocalTimeLuxon(luxon_1.DateTime.utc());
|
|
69
75
|
}
|
|
70
76
|
static fromISO(value, options) {
|
|
71
77
|
return new LocalTimeLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
@@ -73,8 +79,8 @@ class LocalTimeLuxon extends LuxonDateTime {
|
|
|
73
79
|
static fromJSDate(date, options) {
|
|
74
80
|
return new LocalTimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
75
81
|
}
|
|
76
|
-
static fromMillis(
|
|
77
|
-
return new LocalTimeLuxon(luxon_1.DateTime.fromMillis(
|
|
82
|
+
static fromMillis(millis, options) {
|
|
83
|
+
return new LocalTimeLuxon(luxon_1.DateTime.fromMillis(millis, options));
|
|
78
84
|
}
|
|
79
85
|
normalize(dateTime) {
|
|
80
86
|
return luxon_1.DateTime.utc(1970, 1, 1, dateTime.hour, dateTime.minute, dateTime.second);
|
|
@@ -92,17 +98,17 @@ class DateTimeLuxon extends LuxonDateTime {
|
|
|
92
98
|
constructor(input) {
|
|
93
99
|
super(input);
|
|
94
100
|
}
|
|
95
|
-
static now() {
|
|
96
|
-
return new DateTimeLuxon(luxon_1.DateTime.
|
|
101
|
+
static now(options) {
|
|
102
|
+
return new DateTimeLuxon(luxon_1.DateTime.local(options));
|
|
97
103
|
}
|
|
98
104
|
static fromISO(value, options) {
|
|
99
|
-
return new DateTimeLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
105
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromISO(value, Object.assign({ setZone: true }, options)));
|
|
100
106
|
}
|
|
101
107
|
static fromJSDate(date, options) {
|
|
102
108
|
return new DateTimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
103
109
|
}
|
|
104
|
-
static fromMillis(
|
|
105
|
-
return new DateTimeLuxon(luxon_1.DateTime.fromMillis(
|
|
110
|
+
static fromMillis(millis, options) {
|
|
111
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromMillis(millis, options));
|
|
106
112
|
}
|
|
107
113
|
normalize(dateTime) {
|
|
108
114
|
return dateTime.startOf('second');
|
|
@@ -126,16 +132,16 @@ class DateTimeUtcLuxon extends LuxonDateTime {
|
|
|
126
132
|
super(input);
|
|
127
133
|
}
|
|
128
134
|
static now() {
|
|
129
|
-
return new DateTimeUtcLuxon(luxon_1.DateTime.
|
|
135
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.utc());
|
|
130
136
|
}
|
|
131
|
-
static fromISO(value) {
|
|
132
|
-
return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value));
|
|
137
|
+
static fromISO(value, options) {
|
|
138
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
133
139
|
}
|
|
134
140
|
static fromJSDate(date, options) {
|
|
135
|
-
return new DateTimeUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
141
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromJSDate(date, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
136
142
|
}
|
|
137
|
-
static fromMillis(
|
|
138
|
-
return new DateTimeUtcLuxon(luxon_1.DateTime.fromMillis(
|
|
143
|
+
static fromMillis(millis, options) {
|
|
144
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromMillis(millis, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
139
145
|
}
|
|
140
146
|
normalize(dateTime) {
|
|
141
147
|
return dateTime.toUTC().startOf('second');
|
|
@@ -152,17 +158,17 @@ class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
152
158
|
constructor(input) {
|
|
153
159
|
super(input);
|
|
154
160
|
}
|
|
155
|
-
static now() {
|
|
156
|
-
return new DateTimeMillisLuxon(luxon_1.DateTime.
|
|
161
|
+
static now(options) {
|
|
162
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.local(options));
|
|
157
163
|
}
|
|
158
|
-
static fromISO(value) {
|
|
159
|
-
return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value));
|
|
164
|
+
static fromISO(value, options) {
|
|
165
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value, Object.assign({ setZone: true }, options)));
|
|
160
166
|
}
|
|
161
167
|
static fromJSDate(date, options) {
|
|
162
168
|
return new DateTimeMillisLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
163
169
|
}
|
|
164
|
-
static fromMillis(
|
|
165
|
-
return new DateTimeMillisLuxon(luxon_1.DateTime.fromMillis(
|
|
170
|
+
static fromMillis(millis, options) {
|
|
171
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.fromMillis(millis, options));
|
|
166
172
|
}
|
|
167
173
|
normalize(dateTime) {
|
|
168
174
|
return dateTime;
|
|
@@ -186,16 +192,16 @@ class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
186
192
|
super(input);
|
|
187
193
|
}
|
|
188
194
|
static now() {
|
|
189
|
-
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.
|
|
195
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.utc());
|
|
190
196
|
}
|
|
191
197
|
static fromISO(value, options) {
|
|
192
|
-
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
198
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
193
199
|
}
|
|
194
200
|
static fromJSDate(date, options) {
|
|
195
|
-
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
201
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromJSDate(date, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
196
202
|
}
|
|
197
|
-
static fromMillis(
|
|
198
|
-
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromMillis(
|
|
203
|
+
static fromMillis(millis, options) {
|
|
204
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromMillis(millis, Object.assign({ zone: luxon_1.FixedOffsetZone.utcInstance }, options)));
|
|
199
205
|
}
|
|
200
206
|
normalize(dateTime) {
|
|
201
207
|
return dateTime.toUTC();
|
package/dist/test-luxon.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const luxon_1 = require("luxon");
|
|
4
|
-
|
|
4
|
+
const d = luxon_1.DateTime.fromISO('2016-05-25T09:08:34.123');
|
|
5
|
+
console.log(d === d.toUTC());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finnair/v-validation-luxon",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Luxon validators",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"build": "tsc -b ."
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@finnair/path": "^1.1.0-alpha.
|
|
29
|
-
"@finnair/v-validation": "^1.1.0-alpha.
|
|
28
|
+
"@finnair/path": "^1.1.0-alpha.6",
|
|
29
|
+
"@finnair/v-validation": "^1.1.0-alpha.6",
|
|
30
30
|
"luxon": "3.0.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/luxon": "3.0.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "cbca3585a6777f34cd135c6c22be566aea34e69b"
|
|
36
36
|
}
|