test-entity-library-asm 3.9.13 → 3.9.14
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.
|
@@ -12,10 +12,13 @@ class DateTransformer {
|
|
|
12
12
|
return result;
|
|
13
13
|
}
|
|
14
14
|
from(value) {
|
|
15
|
-
if (value
|
|
15
|
+
if (!value)
|
|
16
16
|
return null;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// Interpreta el valor de la DB como UTC
|
|
18
|
+
const utcMoment = moment_timezone_1.default.utc(value);
|
|
19
|
+
// Convierte a la zona del usuario y devuelve como string
|
|
20
|
+
const tz = (0, __1.getTimeZone)(); // "America/Bogota", etc.
|
|
21
|
+
return utcMoment.tz(tz).format("YYYY-MM-DD HH:mm:ss");
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
exports.DateTransformer = DateTransformer;
|
package/package.json
CHANGED
|
@@ -9,9 +9,13 @@ export class DateTransformer implements ValueTransformer {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
from(value: string): Date | null | string {
|
|
12
|
-
if (value
|
|
12
|
+
if (!value) return null;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Interpreta el valor de la DB como UTC
|
|
15
|
+
const utcMoment = moment.utc(value);
|
|
16
|
+
|
|
17
|
+
// Convierte a la zona del usuario y devuelve como string
|
|
18
|
+
const tz = getTimeZone(); // "America/Bogota", etc.
|
|
19
|
+
return utcMoment.tz(tz).format("YYYY-MM-DD HH:mm:ss");
|
|
16
20
|
}
|
|
17
21
|
}
|