@finnair/v-validation-luxon 1.1.0-alpha.0 → 1.1.0-alpha.1
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 +11 -0
- package/dist/luxon.d.ts +7 -0
- package/dist/luxon.js +21 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.1](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2022-08-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* fromISO helper for Luxon wrapper construction ([187796e](https://github.com/finnair/v-validation/commit/187796e707f44033d94943ef64d48626317b4d80))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.1.0-alpha.0](https://github.com/finnair/v-validation/compare/v1.0.1...v1.1.0-alpha.0) (2022-08-12)
|
|
7
18
|
|
|
8
19
|
|
package/dist/luxon.d.ts
CHANGED
|
@@ -13,12 +13,14 @@ 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 fromISO(value: string): DateLuxon;
|
|
16
17
|
protected normalize(dateTime: DateTime): DateTime;
|
|
17
18
|
wrap(fn: (dateTime: DateTime) => DateTime): DateLuxon;
|
|
18
19
|
toJSON(): string;
|
|
19
20
|
}
|
|
20
21
|
export declare class DateUtcLuxon extends LuxonDateTime {
|
|
21
22
|
constructor(input: LuxonDateTimeInput);
|
|
23
|
+
static fromISO(value: string): DateUtcLuxon;
|
|
22
24
|
protected normalize(dateTime: DateTime): DateTime;
|
|
23
25
|
wrap(fn: (dateTime: DateTime) => DateTime): DateUtcLuxon;
|
|
24
26
|
toJSON(): string;
|
|
@@ -27,11 +29,13 @@ export declare class DateTimeLuxon extends LuxonDateTime {
|
|
|
27
29
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss";
|
|
28
30
|
static readonly formatTz: string;
|
|
29
31
|
constructor(input: LuxonDateTimeInput);
|
|
32
|
+
static fromISO(value: string): DateTimeLuxon;
|
|
30
33
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeLuxon;
|
|
31
34
|
toJSON(): string;
|
|
32
35
|
}
|
|
33
36
|
export declare class DateTimeUtcLuxon extends LuxonDateTime {
|
|
34
37
|
constructor(input: LuxonDateTimeInput);
|
|
38
|
+
static fromISO(value: string): DateTimeUtcLuxon;
|
|
35
39
|
protected normalize(dateTime: DateTime): DateTime;
|
|
36
40
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeUtcLuxon;
|
|
37
41
|
toJSON(): string;
|
|
@@ -40,11 +44,13 @@ export declare class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
40
44
|
static readonly format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
|
|
41
45
|
static readonly formatTz: string;
|
|
42
46
|
constructor(input: LuxonDateTimeInput);
|
|
47
|
+
static fromISO(value: string): DateTimeMillisLuxon;
|
|
43
48
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisLuxon;
|
|
44
49
|
toJSON(): string;
|
|
45
50
|
}
|
|
46
51
|
export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
47
52
|
constructor(input: LuxonDateTimeInput);
|
|
53
|
+
static fromISO(value: string): DateTimeMillisUtcLuxon;
|
|
48
54
|
protected normalize(dateTime: DateTime): DateTime;
|
|
49
55
|
wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisUtcLuxon;
|
|
50
56
|
toJSON(): string;
|
|
@@ -52,6 +58,7 @@ export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
52
58
|
export declare class TimeLuxon extends LuxonDateTime {
|
|
53
59
|
static readonly format = "HH:mm:ss";
|
|
54
60
|
constructor(input: LuxonDateTimeInput);
|
|
61
|
+
static fromISO(value: string): TimeLuxon;
|
|
55
62
|
wrap(fn: (dateTime: DateTime) => DateTime): TimeLuxon;
|
|
56
63
|
toJSON(): string;
|
|
57
64
|
}
|
package/dist/luxon.js
CHANGED
|
@@ -36,6 +36,9 @@ class DateLuxon extends LuxonDateTime {
|
|
|
36
36
|
constructor(input) {
|
|
37
37
|
super(input);
|
|
38
38
|
}
|
|
39
|
+
static fromISO(value) {
|
|
40
|
+
return new DateLuxon(luxon_1.DateTime.fromISO(value));
|
|
41
|
+
}
|
|
39
42
|
normalize(dateTime) {
|
|
40
43
|
return dateTime.startOf('day');
|
|
41
44
|
}
|
|
@@ -52,6 +55,9 @@ class DateUtcLuxon extends LuxonDateTime {
|
|
|
52
55
|
constructor(input) {
|
|
53
56
|
super(input);
|
|
54
57
|
}
|
|
58
|
+
static fromISO(value) {
|
|
59
|
+
return new DateUtcLuxon(luxon_1.DateTime.fromISO(value));
|
|
60
|
+
}
|
|
55
61
|
normalize(dateTime) {
|
|
56
62
|
return luxon_1.DateTime.utc(dateTime.year, dateTime.month, dateTime.day, 0, 0, 0);
|
|
57
63
|
}
|
|
@@ -67,6 +73,9 @@ class DateTimeLuxon extends LuxonDateTime {
|
|
|
67
73
|
constructor(input) {
|
|
68
74
|
super(input);
|
|
69
75
|
}
|
|
76
|
+
static fromISO(value) {
|
|
77
|
+
return new DateTimeLuxon(luxon_1.DateTime.fromISO(value));
|
|
78
|
+
}
|
|
70
79
|
wrap(fn) {
|
|
71
80
|
return new DateTimeLuxon(fn(this.dateTime));
|
|
72
81
|
}
|
|
@@ -85,6 +94,9 @@ class DateTimeUtcLuxon extends LuxonDateTime {
|
|
|
85
94
|
constructor(input) {
|
|
86
95
|
super(input);
|
|
87
96
|
}
|
|
97
|
+
static fromISO(value) {
|
|
98
|
+
return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value));
|
|
99
|
+
}
|
|
88
100
|
normalize(dateTime) {
|
|
89
101
|
return dateTime.toUTC();
|
|
90
102
|
}
|
|
@@ -100,6 +112,9 @@ class DateTimeMillisLuxon extends LuxonDateTime {
|
|
|
100
112
|
constructor(input) {
|
|
101
113
|
super(input);
|
|
102
114
|
}
|
|
115
|
+
static fromISO(value) {
|
|
116
|
+
return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value));
|
|
117
|
+
}
|
|
103
118
|
wrap(fn) {
|
|
104
119
|
return new DateTimeMillisLuxon(fn(this.dateTime));
|
|
105
120
|
}
|
|
@@ -118,6 +133,9 @@ class DateTimeMillisUtcLuxon extends LuxonDateTime {
|
|
|
118
133
|
constructor(input) {
|
|
119
134
|
super(input);
|
|
120
135
|
}
|
|
136
|
+
static fromISO(value) {
|
|
137
|
+
return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value));
|
|
138
|
+
}
|
|
121
139
|
normalize(dateTime) {
|
|
122
140
|
return dateTime.toUTC();
|
|
123
141
|
}
|
|
@@ -133,6 +151,9 @@ class TimeLuxon extends LuxonDateTime {
|
|
|
133
151
|
constructor(input) {
|
|
134
152
|
super(input);
|
|
135
153
|
}
|
|
154
|
+
static fromISO(value) {
|
|
155
|
+
return new TimeLuxon(luxon_1.DateTime.fromISO(value));
|
|
156
|
+
}
|
|
136
157
|
wrap(fn) {
|
|
137
158
|
return new TimeLuxon(fn(this.dateTime));
|
|
138
159
|
}
|
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.1",
|
|
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": "b123832373731c3675295cb85fc8bc976676ad92"
|
|
36
36
|
}
|