test-entity-library-asm 3.9.14 → 3.9.16
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.
|
@@ -48,7 +48,7 @@ __decorate([
|
|
|
48
48
|
transformer: new dateTransformer_1.DateTransformer(),
|
|
49
49
|
comment: "Fecha de creación del registro.",
|
|
50
50
|
}),
|
|
51
|
-
__metadata("design:type",
|
|
51
|
+
__metadata("design:type", String)
|
|
52
52
|
], CountryHoliday.prototype, "created", void 0);
|
|
53
53
|
exports.CountryHoliday = CountryHoliday = __decorate([
|
|
54
54
|
(0, typeorm_1.Entity)("country_holiday", {
|
|
@@ -12,13 +12,10 @@ class DateTransformer {
|
|
|
12
12
|
return result;
|
|
13
13
|
}
|
|
14
14
|
from(value) {
|
|
15
|
-
if (
|
|
15
|
+
if (value === null)
|
|
16
16
|
return null;
|
|
17
|
-
|
|
18
|
-
|
|
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");
|
|
17
|
+
const result = moment_timezone_1.default.utc(value).tz((0, __1.getTimeZone)()).toDate();
|
|
18
|
+
return result;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
exports.DateTransformer = DateTransformer;
|
package/package.json
CHANGED
|
@@ -9,13 +9,9 @@ export class DateTransformer implements ValueTransformer {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
from(value: string): Date | null | string {
|
|
12
|
-
if (
|
|
12
|
+
if (value === null) return null;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
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");
|
|
14
|
+
const result = moment.utc(value).tz(getTimeZone()).toDate();
|
|
15
|
+
return result;
|
|
20
16
|
}
|
|
21
17
|
}
|