@leancodepl/api-date-datefns 7.3.7 → 7.4.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 +6 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +6 -0
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -10,6 +10,7 @@ function fromApiTime(time) {
|
|
|
10
10
|
if (!time) {
|
|
11
11
|
return undefined;
|
|
12
12
|
}
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
14
|
return dateFns.parse(time, "HH:mm:ss.SSS", new Date());
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -17,6 +18,7 @@ function toApiTime(time) {
|
|
|
17
18
|
if (!time) {
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
22
|
return dateFns.format(time, "HH:mm:ss.SSS");
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -31,6 +33,7 @@ function toApiDate(date) {
|
|
|
31
33
|
if (!date) {
|
|
32
34
|
return undefined;
|
|
33
35
|
}
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
37
|
return dateFns.format(date, "yyyy-MM-dd");
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -38,6 +41,7 @@ function fromApiDateTimeOffset(dateTimeOffset) {
|
|
|
38
41
|
if (!dateTimeOffset) {
|
|
39
42
|
return undefined;
|
|
40
43
|
}
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
45
|
return dateFns.parse(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", new Date());
|
|
42
46
|
}
|
|
43
47
|
|
|
@@ -45,6 +49,7 @@ function toApiDateTimeOffset(dateTimeOffset) {
|
|
|
45
49
|
if (!dateTimeOffset) {
|
|
46
50
|
return undefined;
|
|
47
51
|
}
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
53
|
return dateFns.format(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -102,6 +107,7 @@ function toApiTimeSpan(differenceInMilliseconds) {
|
|
|
102
107
|
if (milliseconds > 0) {
|
|
103
108
|
stringTimeSpan += `.${milliseconds}`;
|
|
104
109
|
}
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
111
|
return stringTimeSpan;
|
|
106
112
|
}
|
|
107
113
|
|
package/index.esm.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/index.esm.js
CHANGED
|
@@ -6,6 +6,7 @@ function fromApiTime(time) {
|
|
|
6
6
|
if (!time) {
|
|
7
7
|
return undefined;
|
|
8
8
|
}
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
10
|
return parse(time, "HH:mm:ss.SSS", new Date());
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -13,6 +14,7 @@ function toApiTime(time) {
|
|
|
13
14
|
if (!time) {
|
|
14
15
|
return undefined;
|
|
15
16
|
}
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
18
|
return format(time, "HH:mm:ss.SSS");
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -27,6 +29,7 @@ function toApiDate(date) {
|
|
|
27
29
|
if (!date) {
|
|
28
30
|
return undefined;
|
|
29
31
|
}
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
33
|
return format(date, "yyyy-MM-dd");
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -34,6 +37,7 @@ function fromApiDateTimeOffset(dateTimeOffset) {
|
|
|
34
37
|
if (!dateTimeOffset) {
|
|
35
38
|
return undefined;
|
|
36
39
|
}
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
41
|
return parse(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", new Date());
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -41,6 +45,7 @@ function toApiDateTimeOffset(dateTimeOffset) {
|
|
|
41
45
|
if (!dateTimeOffset) {
|
|
42
46
|
return undefined;
|
|
43
47
|
}
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
49
|
return format(dateTimeOffset, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -98,6 +103,7 @@ function toApiTimeSpan(differenceInMilliseconds) {
|
|
|
98
103
|
if (milliseconds > 0) {
|
|
99
104
|
stringTimeSpan += `.${milliseconds}`;
|
|
100
105
|
}
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
107
|
return stringTimeSpan;
|
|
102
108
|
}
|
|
103
109
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/api-date-datefns",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@leancodepl/api-date": "7.
|
|
7
|
-
"@leancodepl/api-date-utils": "7.
|
|
6
|
+
"@leancodepl/api-date": "7.4.0",
|
|
7
|
+
"@leancodepl/api-date-utils": "7.4.0",
|
|
8
8
|
"date-fns": ">=2.0.0"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|