@loomcore/common 0.0.51 → 0.0.52
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.
|
@@ -37,7 +37,11 @@ export const getSystemUserId = () => {
|
|
|
37
37
|
export function TypeboxIsoDate(options = {}) {
|
|
38
38
|
const dateTransform = Type.Transform(Type.String({ format: 'date-time', ...options }))
|
|
39
39
|
.Decode(value => new Date(value))
|
|
40
|
-
.Encode(value =>
|
|
40
|
+
.Encode(value => {
|
|
41
|
+
const date = new Date(value);
|
|
42
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
43
|
+
return date.toISOString();
|
|
44
|
+
});
|
|
41
45
|
return dateTransform;
|
|
42
46
|
}
|
|
43
47
|
export function TypeboxDate(options = {}) {
|
|
@@ -48,6 +52,8 @@ export function TypeboxDate(options = {}) {
|
|
|
48
52
|
return date;
|
|
49
53
|
})
|
|
50
54
|
.Encode(value => {
|
|
55
|
+
const date = new Date(value);
|
|
56
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
51
57
|
return value.toISOString().split('T')[0];
|
|
52
58
|
});
|
|
53
59
|
return dateTransform;
|
package/package.json
CHANGED