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 === null)
15
+ if (!value)
16
16
  return null;
17
- const result = moment_timezone_1.default.utc(value).tz((0, __1.getTimeZone)()).toDate();
18
- return result;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.9.13",
3
+ "version": "3.9.14",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,9 +9,13 @@ export class DateTransformer implements ValueTransformer {
9
9
  }
10
10
 
11
11
  from(value: string): Date | null | string {
12
- if (value === null) return null;
12
+ if (!value) return null;
13
13
 
14
- const result = moment.utc(value).tz(getTimeZone()).toDate();
15
- return result;
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
  }