@leancodepl/api-date-datefns 7.8.2 → 8.0.0
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/index.cjs.js +1 -9
- package/index.esm.js +0 -6
- package/package.json +6 -4
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var apiDate = require('@leancodepl/api-date');
|
|
6
4
|
var dateFns = require('date-fns');
|
|
7
5
|
var apiDateUtils = require('@leancodepl/api-date-utils');
|
|
@@ -10,7 +8,6 @@ function fromApiTime(time) {
|
|
|
10
8
|
if (!time) {
|
|
11
9
|
return undefined;
|
|
12
10
|
}
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
11
|
return dateFns.parse(time, "HH:mm:ss.SSS", new Date());
|
|
15
12
|
}
|
|
16
13
|
|
|
@@ -18,7 +15,6 @@ function toApiTime(time) {
|
|
|
18
15
|
if (!time) {
|
|
19
16
|
return undefined;
|
|
20
17
|
}
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
18
|
return dateFns.format(time, "HH:mm:ss.SSS");
|
|
23
19
|
}
|
|
24
20
|
|
|
@@ -33,7 +29,6 @@ function toApiDate(date) {
|
|
|
33
29
|
if (!date) {
|
|
34
30
|
return undefined;
|
|
35
31
|
}
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
32
|
return dateFns.format(date, "yyyy-MM-dd");
|
|
38
33
|
}
|
|
39
34
|
|
|
@@ -41,7 +36,6 @@ function fromApiDateTimeOffset(dateTimeOffset) {
|
|
|
41
36
|
if (!dateTimeOffset) {
|
|
42
37
|
return undefined;
|
|
43
38
|
}
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
39
|
return dateFns.parse(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", new Date());
|
|
46
40
|
}
|
|
47
41
|
|
|
@@ -49,7 +43,6 @@ function toApiDateTimeOffset(dateTimeOffset) {
|
|
|
49
43
|
if (!dateTimeOffset) {
|
|
50
44
|
return undefined;
|
|
51
45
|
}
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
46
|
return dateFns.format(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
54
47
|
}
|
|
55
48
|
|
|
@@ -107,7 +100,6 @@ function toApiTimeSpan(differenceInMilliseconds) {
|
|
|
107
100
|
if (milliseconds > 0) {
|
|
108
101
|
stringTimeSpan += `.${milliseconds}`;
|
|
109
102
|
}
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
103
|
return stringTimeSpan;
|
|
112
104
|
}
|
|
113
105
|
|
|
@@ -120,7 +112,7 @@ exports.toApiDateTimeOffset = toApiDateTimeOffset;
|
|
|
120
112
|
exports.toApiTime = toApiTime;
|
|
121
113
|
exports.toApiTimeSpan = toApiTimeSpan;
|
|
122
114
|
Object.keys(apiDate).forEach(function (k) {
|
|
123
|
-
if (k !== 'default' && !
|
|
115
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
124
116
|
enumerable: true,
|
|
125
117
|
get: function () { return apiDate[k]; }
|
|
126
118
|
});
|
package/index.esm.js
CHANGED
|
@@ -6,7 +6,6 @@ function fromApiTime(time) {
|
|
|
6
6
|
if (!time) {
|
|
7
7
|
return undefined;
|
|
8
8
|
}
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
9
|
return parse(time, "HH:mm:ss.SSS", new Date());
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -14,7 +13,6 @@ function toApiTime(time) {
|
|
|
14
13
|
if (!time) {
|
|
15
14
|
return undefined;
|
|
16
15
|
}
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
16
|
return format(time, "HH:mm:ss.SSS");
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -29,7 +27,6 @@ function toApiDate(date) {
|
|
|
29
27
|
if (!date) {
|
|
30
28
|
return undefined;
|
|
31
29
|
}
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
30
|
return format(date, "yyyy-MM-dd");
|
|
34
31
|
}
|
|
35
32
|
|
|
@@ -37,7 +34,6 @@ function fromApiDateTimeOffset(dateTimeOffset) {
|
|
|
37
34
|
if (!dateTimeOffset) {
|
|
38
35
|
return undefined;
|
|
39
36
|
}
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
37
|
return parse(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", new Date());
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -45,7 +41,6 @@ function toApiDateTimeOffset(dateTimeOffset) {
|
|
|
45
41
|
if (!dateTimeOffset) {
|
|
46
42
|
return undefined;
|
|
47
43
|
}
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
44
|
return format(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
50
45
|
}
|
|
51
46
|
|
|
@@ -103,7 +98,6 @@ function toApiTimeSpan(differenceInMilliseconds) {
|
|
|
103
98
|
if (milliseconds > 0) {
|
|
104
99
|
stringTimeSpan += `.${milliseconds}`;
|
|
105
100
|
}
|
|
106
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
101
|
return stringTimeSpan;
|
|
108
102
|
}
|
|
109
103
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/api-date-datefns",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@leancodepl/api-date": "
|
|
7
|
-
"@leancodepl/api-date-utils": "
|
|
6
|
+
"@leancodepl/api-date": "8.0.0",
|
|
7
|
+
"@leancodepl/api-date-utils": "8.0.0",
|
|
8
8
|
"date-fns": ">=2.0.0"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
"./package.json": "./package.json",
|
|
15
15
|
".": {
|
|
16
16
|
"module": "./index.esm.js",
|
|
17
|
+
"types": "./index.esm.d.ts",
|
|
17
18
|
"import": "./index.cjs.mjs",
|
|
18
19
|
"default": "./index.cjs.js"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"module": "./index.esm.js",
|
|
22
|
-
"main": "./index.cjs.js"
|
|
23
|
+
"main": "./index.cjs.js",
|
|
24
|
+
"types": "./index.esm.d.ts"
|
|
23
25
|
}
|