@finnair/v-validation-luxon 1.1.0-alpha.0 → 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,36 @@
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
+
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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * Fix exports ([c4c42f7](https://github.com/finnair/v-validation/commit/c4c42f715e8c52b29b76f7f07753f632528a69ab))
20
+
21
+
22
+
23
+
24
+
25
+ # [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)
26
+
27
+
28
+ ### Features
29
+
30
+ * fromISO helper for Luxon wrapper construction ([187796e](https://github.com/finnair/v-validation/commit/187796e707f44033d94943ef64d48626317b4d80))
31
+
32
+
33
+
34
+
35
+
6
36
  # [1.1.0-alpha.0](https://github.com/finnair/v-validation/compare/v1.0.1...v1.1.0-alpha.0) (2022-08-12)
7
37
 
8
38
 
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,12 +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, options?: Object): DateLuxon;
17
+ static fromJSDate(date: Date, options?: Object): DateLuxon;
18
+ static fromMillis(milliseconds: number, options?: Object): DateLuxon;
16
19
  protected normalize(dateTime: DateTime): DateTime;
17
20
  wrap(fn: (dateTime: DateTime) => DateTime): DateLuxon;
18
21
  toJSON(): string;
19
22
  }
20
23
  export declare class DateUtcLuxon extends LuxonDateTime {
21
24
  constructor(input: LuxonDateTimeInput);
25
+ static fromISO(value: string, options?: Object): DateUtcLuxon;
26
+ static fromJSDate(date: Date, options?: Object): DateUtcLuxon;
27
+ static fromMillis(milliseconds: number, options?: Object): DateUtcLuxon;
22
28
  protected normalize(dateTime: DateTime): DateTime;
23
29
  wrap(fn: (dateTime: DateTime) => DateTime): DateUtcLuxon;
24
30
  toJSON(): string;
@@ -27,11 +33,17 @@ export declare class DateTimeLuxon extends LuxonDateTime {
27
33
  static readonly format = "yyyy-MM-dd'T'HH:mm:ss";
28
34
  static readonly formatTz: string;
29
35
  constructor(input: LuxonDateTimeInput);
36
+ static fromISO(value: string, options?: Object): DateTimeLuxon;
37
+ static fromJSDate(date: Date, options?: Object): DateTimeLuxon;
38
+ static fromMillis(milliseconds: number, options?: Object): DateTimeLuxon;
30
39
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeLuxon;
31
40
  toJSON(): string;
32
41
  }
33
42
  export declare class DateTimeUtcLuxon extends LuxonDateTime {
34
43
  constructor(input: LuxonDateTimeInput);
44
+ static fromISO(value: string): DateTimeUtcLuxon;
45
+ static fromJSDate(date: Date, options?: Object): DateTimeUtcLuxon;
46
+ static fromMillis(milliseconds: number, options?: Object): DateTimeUtcLuxon;
35
47
  protected normalize(dateTime: DateTime): DateTime;
36
48
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeUtcLuxon;
37
49
  toJSON(): string;
@@ -40,11 +52,17 @@ export declare class DateTimeMillisLuxon extends LuxonDateTime {
40
52
  static readonly format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
41
53
  static readonly formatTz: string;
42
54
  constructor(input: LuxonDateTimeInput);
55
+ static fromISO(value: string): DateTimeMillisLuxon;
56
+ static fromJSDate(date: Date, options?: Object): DateTimeMillisLuxon;
57
+ static fromMillis(milliseconds: number, options?: Object): DateTimeMillisLuxon;
43
58
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisLuxon;
44
59
  toJSON(): string;
45
60
  }
46
61
  export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
47
62
  constructor(input: LuxonDateTimeInput);
63
+ static fromISO(value: string, options?: Object): DateTimeMillisUtcLuxon;
64
+ static fromJSDate(date: Date, options?: Object): DateTimeMillisUtcLuxon;
65
+ static fromMillis(milliseconds: number, options?: Object): DateTimeMillisUtcLuxon;
48
66
  protected normalize(dateTime: DateTime): DateTime;
49
67
  wrap(fn: (dateTime: DateTime) => DateTime): DateTimeMillisUtcLuxon;
50
68
  toJSON(): string;
@@ -52,6 +70,9 @@ export declare class DateTimeMillisUtcLuxon extends LuxonDateTime {
52
70
  export declare class TimeLuxon extends LuxonDateTime {
53
71
  static readonly format = "HH:mm:ss";
54
72
  constructor(input: LuxonDateTimeInput);
73
+ static fromISO(value: string, options?: Object): TimeLuxon;
74
+ static fromJSDate(date: Date, options?: Object): TimeLuxon;
75
+ static fromMillis(milliseconds: number, options?: Object): TimeLuxon;
55
76
  wrap(fn: (dateTime: DateTime) => DateTime): TimeLuxon;
56
77
  toJSON(): string;
57
78
  }
package/dist/luxon.js CHANGED
@@ -36,6 +36,15 @@ class DateLuxon extends LuxonDateTime {
36
36
  constructor(input) {
37
37
  super(input);
38
38
  }
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));
47
+ }
39
48
  normalize(dateTime) {
40
49
  return dateTime.startOf('day');
41
50
  }
@@ -52,6 +61,15 @@ class DateUtcLuxon extends LuxonDateTime {
52
61
  constructor(input) {
53
62
  super(input);
54
63
  }
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));
72
+ }
55
73
  normalize(dateTime) {
56
74
  return luxon_1.DateTime.utc(dateTime.year, dateTime.month, dateTime.day, 0, 0, 0);
57
75
  }
@@ -67,6 +85,15 @@ class DateTimeLuxon extends LuxonDateTime {
67
85
  constructor(input) {
68
86
  super(input);
69
87
  }
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));
96
+ }
70
97
  wrap(fn) {
71
98
  return new DateTimeLuxon(fn(this.dateTime));
72
99
  }
@@ -85,6 +112,15 @@ class DateTimeUtcLuxon extends LuxonDateTime {
85
112
  constructor(input) {
86
113
  super(input);
87
114
  }
115
+ static fromISO(value) {
116
+ return new DateTimeUtcLuxon(luxon_1.DateTime.fromISO(value));
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
+ }
88
124
  normalize(dateTime) {
89
125
  return dateTime.toUTC();
90
126
  }
@@ -100,6 +136,15 @@ class DateTimeMillisLuxon extends LuxonDateTime {
100
136
  constructor(input) {
101
137
  super(input);
102
138
  }
139
+ static fromISO(value) {
140
+ return new DateTimeMillisLuxon(luxon_1.DateTime.fromISO(value));
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
+ }
103
148
  wrap(fn) {
104
149
  return new DateTimeMillisLuxon(fn(this.dateTime));
105
150
  }
@@ -118,6 +163,15 @@ class DateTimeMillisUtcLuxon extends LuxonDateTime {
118
163
  constructor(input) {
119
164
  super(input);
120
165
  }
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));
174
+ }
121
175
  normalize(dateTime) {
122
176
  return dateTime.toUTC();
123
177
  }
@@ -133,6 +187,15 @@ class TimeLuxon extends LuxonDateTime {
133
187
  constructor(input) {
134
188
  super(input);
135
189
  }
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));
198
+ }
136
199
  wrap(fn) {
137
200
  return new TimeLuxon(fn(this.dateTime));
138
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finnair/v-validation-luxon",
3
- "version": "1.1.0-alpha.0",
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": "980da25d0eb031a0ed89691c97459b23efcdc8a5"
35
+ "gitHead": "43c45eb094c963918a9dee423abde9090632a595"
36
36
  }