@finnair/v-validation-luxon 1.1.0-alpha.1 → 1.1.0-alpha.4
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 +27 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/luxon.d.ts +26 -5
- package/dist/luxon.js +73 -10
- package/dist/test-luxon.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.4](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2022-08-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @finnair/v-validation-luxon
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.1.0-alpha.3](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2022-08-15)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @finnair/v-validation-luxon
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.1.0-alpha.2](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.1...v1.1.0-alpha.2) (2022-08-12)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* Fix exports ([c4c42f7](https://github.com/finnair/v-validation/commit/c4c42f715e8c52b29b76f7f07753f632528a69ab))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [1.1.0-alpha.1](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2022-08-12)
|
|
7
34
|
|
|
8
35
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Vluxon';
|
|
2
|
-
export * from 'luxon';
|
|
2
|
+
export * from './luxon';
|
package/dist/index.js
CHANGED
|
@@ -11,4 +11,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Vluxon"), exports);
|
|
14
|
-
__exportStar(require("luxon"), exports);
|
|
14
|
+
__exportStar(require("./luxon"), exports);
|
package/dist/luxon.d.ts
CHANGED
|
@@ -13,14 +13,20 @@ export declare abstract class LuxonDateTime {
|
|
|
13
13
|
export declare class DateLuxon extends LuxonDateTime {
|
|
14
14
|
static readonly format = "yyyy-MM-dd";
|
|
15
15
|
constructor(input: LuxonDateTimeInput);
|
|
16
|
-
static
|
|
16
|
+
static now(): DateLuxon;
|
|
17
|
+
static fromISO(value: string, options?: Object): DateLuxon;
|
|
18
|
+
static fromJSDate(date: Date, options?: Object): DateLuxon;
|
|
19
|
+
static fromMillis(milliseconds: number, options?: Object): DateLuxon;
|
|
17
20
|
protected normalize(dateTime: DateTime): DateTime;
|
|
18
21
|
wrap(fn: (dateTime: DateTime) => DateTime): DateLuxon;
|
|
19
22
|
toJSON(): string;
|
|
20
23
|
}
|
|
21
24
|
export declare class DateUtcLuxon extends LuxonDateTime {
|
|
22
25
|
constructor(input: LuxonDateTimeInput);
|
|
23
|
-
static
|
|
26
|
+
static now(): DateUtcLuxon;
|
|
27
|
+
static fromISO(value: string, options?: Object): DateUtcLuxon;
|
|
28
|
+
static fromJSDate(date: Date, options?: Object): DateUtcLuxon;
|
|
29
|
+
static fromMillis(milliseconds: number, options?: Object): DateUtcLuxon;
|
|
24
30
|
protected normalize(dateTime: DateTime): DateTime;
|
|
25
31
|
wrap(fn: (dateTime: DateTime) => DateTime): DateUtcLuxon;
|
|
26
32
|
toJSON(): string;
|
|
@@ -29,13 +35,19 @@ export declare class DateTimeLuxon extends LuxonDateTime {
|
|
|
29
35
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss";
|
|
30
36
|
static readonly formatTz: string;
|
|
31
37
|
constructor(input: LuxonDateTimeInput);
|
|
32
|
-
static
|
|
38
|
+
static now(): DateTimeLuxon;
|
|
39
|
+
static fromISO(value: string, options?: Object): DateTimeLuxon;
|
|
40
|
+
static fromJSDate(date: Date, options?: Object): DateTimeLuxon;
|
|
41
|
+
static fromMillis(milliseconds: number, options?: Object): DateTimeLuxon;
|
|
33
42
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeLuxon;
|
|
34
43
|
toJSON(): string;
|
|
35
44
|
}
|
|
36
45
|
export declare class DateTimeUtcLuxon extends LuxonDateTime {
|
|
37
46
|
constructor(input: LuxonDateTimeInput);
|
|
47
|
+
static now(): DateTimeUtcLuxon;
|
|
38
48
|
static fromISO(value: string): DateTimeUtcLuxon;
|
|
49
|
+
static fromJSDate(date: Date, options?: Object): DateTimeUtcLuxon;
|
|
50
|
+
static fromMillis(milliseconds: number, options?: Object): DateTimeUtcLuxon;
|
|
39
51
|
protected normalize(dateTime: DateTime): DateTime;
|
|
40
52
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeUtcLuxon;
|
|
41
53
|
toJSON(): string;
|
|
@@ -44,13 +56,19 @@ export declare class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
44
56
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
|
|
45
57
|
static readonly formatTz: string;
|
|
46
58
|
constructor(input: LuxonDateTimeInput);
|
|
59
|
+
static now(): DateTimeMillisLuxon;
|
|
47
60
|
static fromISO(value: string): DateTimeMillisLuxon;
|
|
61
|
+
static fromJSDate(date: Date, options?: Object): DateTimeMillisLuxon;
|
|
62
|
+
static fromMillis(milliseconds: number, options?: Object): DateTimeMillisLuxon;
|
|
48
63
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisLuxon;
|
|
49
64
|
toJSON(): string;
|
|
50
65
|
}
|
|
51
66
|
export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
52
67
|
constructor(input: LuxonDateTimeInput);
|
|
53
|
-
static
|
|
68
|
+
static now(): DateTimeMillisUtcLuxon;
|
|
69
|
+
static fromISO(value: string, options?: Object): DateTimeMillisUtcLuxon;
|
|
70
|
+
static fromJSDate(date: Date, options?: Object): DateTimeMillisUtcLuxon;
|
|
71
|
+
static fromMillis(milliseconds: number, options?: Object): DateTimeMillisUtcLuxon;
|
|
54
72
|
protected normalize(dateTime: DateTime): DateTime;
|
|
55
73
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisUtcLuxon;
|
|
56
74
|
toJSON(): string;
|
|
@@ -58,7 +76,10 @@ export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
58
76
|
export declare class TimeLuxon extends LuxonDateTime {
|
|
59
77
|
static readonly format = "HH:mm:ss";
|
|
60
78
|
constructor(input: LuxonDateTimeInput);
|
|
61
|
-
static
|
|
79
|
+
static now(): TimeLuxon;
|
|
80
|
+
static fromISO(value: string, options?: Object): TimeLuxon;
|
|
81
|
+
static fromJSDate(date: Date, options?: Object): TimeLuxon;
|
|
82
|
+
static fromMillis(milliseconds: number, options?: Object): TimeLuxon;
|
|
62
83
|
wrap(fn: (dateTime: DateTime) => DateTime): TimeLuxon;
|
|
63
84
|
toJSON(): string;
|
|
64
85
|
}
|
package/dist/luxon.js
CHANGED
|
@@ -36,8 +36,17 @@ class DateLuxon extends LuxonDateTime {
|
|
|
36
36
|
constructor(input) {
|
|
37
37
|
super(input);
|
|
38
38
|
}
|
|
39
|
-
static
|
|
40
|
-
return new DateLuxon(luxon_1.DateTime.
|
|
39
|
+
static now() {
|
|
40
|
+
return new DateLuxon(luxon_1.DateTime.now());
|
|
41
|
+
}
|
|
42
|
+
static fromISO(value, options) {
|
|
43
|
+
return new DateLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
44
|
+
}
|
|
45
|
+
static fromJSDate(date, options) {
|
|
46
|
+
return new DateLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
47
|
+
}
|
|
48
|
+
static fromMillis(milliseconds, options) {
|
|
49
|
+
return new DateLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
41
50
|
}
|
|
42
51
|
normalize(dateTime) {
|
|
43
52
|
return dateTime.startOf('day');
|
|
@@ -55,8 +64,17 @@ class DateUtcLuxon extends LuxonDateTime {
|
|
|
55
64
|
constructor(input) {
|
|
56
65
|
super(input);
|
|
57
66
|
}
|
|
58
|
-
static
|
|
59
|
-
return new DateUtcLuxon(luxon_1.DateTime.
|
|
67
|
+
static now() {
|
|
68
|
+
return new DateUtcLuxon(luxon_1.DateTime.now());
|
|
69
|
+
}
|
|
70
|
+
static fromISO(value, options) {
|
|
71
|
+
return new DateUtcLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
72
|
+
}
|
|
73
|
+
static fromJSDate(date, options) {
|
|
74
|
+
return new DateUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
75
|
+
}
|
|
76
|
+
static fromMillis(milliseconds, options) {
|
|
77
|
+
return new DateUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
60
78
|
}
|
|
61
79
|
normalize(dateTime) {
|
|
62
80
|
return luxon_1.DateTime.utc(dateTime.year, dateTime.month, dateTime.day, 0, 0, 0);
|
|
@@ -73,8 +91,17 @@ class DateTimeLuxon extends LuxonDateTime {
|
|
|
73
91
|
constructor(input) {
|
|
74
92
|
super(input);
|
|
75
93
|
}
|
|
76
|
-
static
|
|
77
|
-
return new DateTimeLuxon(luxon_1.DateTime.
|
|
94
|
+
static now() {
|
|
95
|
+
return new DateTimeLuxon(luxon_1.DateTime.now());
|
|
96
|
+
}
|
|
97
|
+
static fromISO(value, options) {
|
|
98
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
99
|
+
}
|
|
100
|
+
static fromJSDate(date, options) {
|
|
101
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
102
|
+
}
|
|
103
|
+
static fromMillis(milliseconds, options) {
|
|
104
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
78
105
|
}
|
|
79
106
|
wrap(fn) {
|
|
80
107
|
return new DateTimeLuxon(fn(this.dateTime));
|
|
@@ -94,9 +121,18 @@ class DateTimeUtcLuxon extends LuxonDateTime {
|
|
|
94
121
|
constructor(input) {
|
|
95
122
|
super(input);
|
|
96
123
|
}
|
|
124
|
+
static now() {
|
|
125
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.now());
|
|
126
|
+
}
|
|
97
127
|
static fromISO(value) {
|
|
98
128
|
return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value));
|
|
99
129
|
}
|
|
130
|
+
static fromJSDate(date, options) {
|
|
131
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
132
|
+
}
|
|
133
|
+
static fromMillis(milliseconds, options) {
|
|
134
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
135
|
+
}
|
|
100
136
|
normalize(dateTime) {
|
|
101
137
|
return dateTime.toUTC();
|
|
102
138
|
}
|
|
@@ -112,9 +148,18 @@ class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
112
148
|
constructor(input) {
|
|
113
149
|
super(input);
|
|
114
150
|
}
|
|
151
|
+
static now() {
|
|
152
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.now());
|
|
153
|
+
}
|
|
115
154
|
static fromISO(value) {
|
|
116
155
|
return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value));
|
|
117
156
|
}
|
|
157
|
+
static fromJSDate(date, options) {
|
|
158
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
159
|
+
}
|
|
160
|
+
static fromMillis(milliseconds, options) {
|
|
161
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
162
|
+
}
|
|
118
163
|
wrap(fn) {
|
|
119
164
|
return new DateTimeMillisLuxon(fn(this.dateTime));
|
|
120
165
|
}
|
|
@@ -133,8 +178,17 @@ class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
133
178
|
constructor(input) {
|
|
134
179
|
super(input);
|
|
135
180
|
}
|
|
136
|
-
static
|
|
137
|
-
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.
|
|
181
|
+
static now() {
|
|
182
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.now());
|
|
183
|
+
}
|
|
184
|
+
static fromISO(value, options) {
|
|
185
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
186
|
+
}
|
|
187
|
+
static fromJSDate(date, options) {
|
|
188
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
189
|
+
}
|
|
190
|
+
static fromMillis(milliseconds, options) {
|
|
191
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
138
192
|
}
|
|
139
193
|
normalize(dateTime) {
|
|
140
194
|
return dateTime.toUTC();
|
|
@@ -151,8 +205,17 @@ class TimeLuxon extends LuxonDateTime {
|
|
|
151
205
|
constructor(input) {
|
|
152
206
|
super(input);
|
|
153
207
|
}
|
|
154
|
-
static
|
|
155
|
-
return new TimeLuxon(luxon_1.DateTime.
|
|
208
|
+
static now() {
|
|
209
|
+
return new TimeLuxon(luxon_1.DateTime.now());
|
|
210
|
+
}
|
|
211
|
+
static fromISO(value, options) {
|
|
212
|
+
return new TimeLuxon(luxon_1.DateTime.fromISO(value, options));
|
|
213
|
+
}
|
|
214
|
+
static fromJSDate(date, options) {
|
|
215
|
+
return new TimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
|
|
216
|
+
}
|
|
217
|
+
static fromMillis(milliseconds, options) {
|
|
218
|
+
return new TimeLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
|
|
156
219
|
}
|
|
157
220
|
wrap(fn) {
|
|
158
221
|
return new TimeLuxon(fn(this.dateTime));
|
package/dist/test-luxon.js
CHANGED
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.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Luxon validators",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/luxon": "3.0.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "d2478122e33d247af89e16c84e8093b5f9bee294"
|
|
36
36
|
}
|