@finnair/v-validation-luxon 1.1.0-alpha.2 → 1.1.0-alpha.3

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 CHANGED
@@ -3,6 +3,14 @@
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.3](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2022-08-15)
7
+
8
+ **Note:** Version bump only for package @finnair/v-validation-luxon
9
+
10
+
11
+
12
+
13
+
6
14
  # [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)
7
15
 
8
16
 
package/dist/luxon.d.ts CHANGED
@@ -13,14 +13,18 @@ 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
+ static fromISO(value: string, options?: Object): DateLuxon;
17
+ static fromJSDate(date: Date, options?: Object): DateLuxon;
18
+ static fromMillis(milliseconds: number, options?: Object): DateLuxon;
17
19
  protected normalize(dateTime: DateTime): DateTime;
18
20
  wrap(fn: (dateTime: DateTime) => DateTime): DateLuxon;
19
21
  toJSON(): string;
20
22
  }
21
23
  export declare class DateUtcLuxon extends LuxonDateTime {
22
24
  constructor(input: LuxonDateTimeInput);
23
- static fromISO(value: string): DateUtcLuxon;
25
+ static fromISO(value: string, options?: Object): DateUtcLuxon;
26
+ static fromJSDate(date: Date, options?: Object): DateUtcLuxon;
27
+ static fromMillis(milliseconds: number, options?: Object): DateUtcLuxon;
24
28
  protected normalize(dateTime: DateTime): DateTime;
25
29
  wrap(fn: (dateTime: DateTime) => DateTime): DateUtcLuxon;
26
30
  toJSON(): string;
@@ -29,13 +33,17 @@ export declare class DateTimeLuxon extends LuxonDateTime {
29
33
  static readonly format = "yyyy-MM-dd'T'HH:mm:ss";
30
34
  static readonly formatTz: string;
31
35
  constructor(input: LuxonDateTimeInput);
32
- static fromISO(value: string): DateTimeLuxon;
36
+ static fromISO(value: string, options?: Object): DateTimeLuxon;
37
+ static fromJSDate(date: Date, options?: Object): DateTimeLuxon;
38
+ static fromMillis(milliseconds: number, options?: Object): DateTimeLuxon;
33
39
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeLuxon;
34
40
  toJSON(): string;
35
41
  }
36
42
  export declare class DateTimeUtcLuxon extends LuxonDateTime {
37
43
  constructor(input: LuxonDateTimeInput);
38
44
  static fromISO(value: string): DateTimeUtcLuxon;
45
+ static fromJSDate(date: Date, options?: Object): DateTimeUtcLuxon;
46
+ static fromMillis(milliseconds: number, options?: Object): DateTimeUtcLuxon;
39
47
  protected normalize(dateTime: DateTime): DateTime;
40
48
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeUtcLuxon;
41
49
  toJSON(): string;
@@ -45,12 +53,16 @@ export declare class DateTimeMillisLuxon extends LuxonDateTime {
45
53
  static readonly formatTz: string;
46
54
  constructor(input: LuxonDateTimeInput);
47
55
  static fromISO(value: string): DateTimeMillisLuxon;
56
+ static fromJSDate(date: Date, options?: Object): DateTimeMillisLuxon;
57
+ static fromMillis(milliseconds: number, options?: Object): DateTimeMillisLuxon;
48
58
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisLuxon;
49
59
  toJSON(): string;
50
60
  }
51
61
  export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
52
62
  constructor(input: LuxonDateTimeInput);
53
- static fromISO(value: string): DateTimeMillisUtcLuxon;
63
+ static fromISO(value: string, options?: Object): DateTimeMillisUtcLuxon;
64
+ static fromJSDate(date: Date, options?: Object): DateTimeMillisUtcLuxon;
65
+ static fromMillis(milliseconds: number, options?: Object): DateTimeMillisUtcLuxon;
54
66
  protected normalize(dateTime: DateTime): DateTime;
55
67
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisUtcLuxon;
56
68
  toJSON(): string;
@@ -58,7 +70,9 @@ export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
58
70
  export declare class TimeLuxon extends LuxonDateTime {
59
71
  static readonly format = "HH:mm:ss";
60
72
  constructor(input: LuxonDateTimeInput);
61
- static fromISO(value: string): TimeLuxon;
73
+ static fromISO(value: string, options?: Object): TimeLuxon;
74
+ static fromJSDate(date: Date, options?: Object): TimeLuxon;
75
+ static fromMillis(milliseconds: number, options?: Object): TimeLuxon;
62
76
  wrap(fn: (dateTime: DateTime) => DateTime): TimeLuxon;
63
77
  toJSON(): string;
64
78
  }
package/dist/luxon.js CHANGED
@@ -36,8 +36,14 @@ 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));
39
+ static fromISO(value, options) {
40
+ return new DateLuxon(luxon_1.DateTime.fromISO(value, options));
41
+ }
42
+ static fromJSDate(date, options) {
43
+ return new DateLuxon(luxon_1.DateTime.fromJSDate(date, options));
44
+ }
45
+ static fromMillis(milliseconds, options) {
46
+ return new DateLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
41
47
  }
42
48
  normalize(dateTime) {
43
49
  return dateTime.startOf('day');
@@ -55,8 +61,14 @@ class DateUtcLuxon extends LuxonDateTime {
55
61
  constructor(input) {
56
62
  super(input);
57
63
  }
58
- static fromISO(value) {
59
- return new DateUtcLuxon(luxon_1.DateTime.fromISO(value));
64
+ static fromISO(value, options) {
65
+ return new DateUtcLuxon(luxon_1.DateTime.fromISO(value, options));
66
+ }
67
+ static fromJSDate(date, options) {
68
+ return new DateUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
69
+ }
70
+ static fromMillis(milliseconds, options) {
71
+ return new DateUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
60
72
  }
61
73
  normalize(dateTime) {
62
74
  return luxon_1.DateTime.utc(dateTime.year, dateTime.month, dateTime.day, 0, 0, 0);
@@ -73,8 +85,14 @@ class DateTimeLuxon extends LuxonDateTime {
73
85
  constructor(input) {
74
86
  super(input);
75
87
  }
76
- static fromISO(value) {
77
- return new DateTimeLuxon(luxon_1.DateTime.fromISO(value));
88
+ static fromISO(value, options) {
89
+ return new DateTimeLuxon(luxon_1.DateTime.fromISO(value, options));
90
+ }
91
+ static fromJSDate(date, options) {
92
+ return new DateTimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
93
+ }
94
+ static fromMillis(milliseconds, options) {
95
+ return new DateTimeLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
78
96
  }
79
97
  wrap(fn) {
80
98
  return new DateTimeLuxon(fn(this.dateTime));
@@ -97,6 +115,12 @@ class DateTimeUtcLuxon extends LuxonDateTime {
97
115
  static fromISO(value) {
98
116
  return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value));
99
117
  }
118
+ static fromJSDate(date, options) {
119
+ return new DateTimeUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
120
+ }
121
+ static fromMillis(milliseconds, options) {
122
+ return new DateTimeUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
123
+ }
100
124
  normalize(dateTime) {
101
125
  return dateTime.toUTC();
102
126
  }
@@ -115,6 +139,12 @@ class DateTimeMillisLuxon extends LuxonDateTime {
115
139
  static fromISO(value) {
116
140
  return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value));
117
141
  }
142
+ static fromJSDate(date, options) {
143
+ return new DateTimeMillisLuxon(luxon_1.DateTime.fromJSDate(date, options));
144
+ }
145
+ static fromMillis(milliseconds, options) {
146
+ return new DateTimeMillisLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
147
+ }
118
148
  wrap(fn) {
119
149
  return new DateTimeMillisLuxon(fn(this.dateTime));
120
150
  }
@@ -133,8 +163,14 @@ class DateTimeMillisUtcLuxon extends LuxonDateTime {
133
163
  constructor(input) {
134
164
  super(input);
135
165
  }
136
- static fromISO(value) {
137
- return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value));
166
+ static fromISO(value, options) {
167
+ return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromISO(value, options));
168
+ }
169
+ static fromJSDate(date, options) {
170
+ return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromJSDate(date, options));
171
+ }
172
+ static fromMillis(milliseconds, options) {
173
+ return new DateTimeMillisUtcLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
138
174
  }
139
175
  normalize(dateTime) {
140
176
  return dateTime.toUTC();
@@ -151,8 +187,14 @@ class TimeLuxon extends LuxonDateTime {
151
187
  constructor(input) {
152
188
  super(input);
153
189
  }
154
- static fromISO(value) {
155
- return new TimeLuxon(luxon_1.DateTime.fromISO(value));
190
+ static fromISO(value, options) {
191
+ return new TimeLuxon(luxon_1.DateTime.fromISO(value, options));
192
+ }
193
+ static fromJSDate(date, options) {
194
+ return new TimeLuxon(luxon_1.DateTime.fromJSDate(date, options));
195
+ }
196
+ static fromMillis(milliseconds, options) {
197
+ return new TimeLuxon(luxon_1.DateTime.fromMillis(milliseconds, options));
156
198
  }
157
199
  wrap(fn) {
158
200
  return new TimeLuxon(fn(this.dateTime));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finnair/v-validation-luxon",
3
- "version": "1.1.0-alpha.2",
3
+ "version": "1.1.0-alpha.3",
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": "731e1d36f0d34f911edb74d3cfa3e726f55057a3"
35
+ "gitHead": "43c45eb094c963918a9dee423abde9090632a595"
36
36
  }