test-entity-library-asm 1.7.7 → 1.7.8

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.
@@ -6,10 +6,10 @@ var DateTransformer = /** @class */ (function () {
6
6
  function DateTransformer() {
7
7
  }
8
8
  DateTransformer.prototype.to = function (value) {
9
- return value; // Deja la fecha en UTC al guardar en la base de datos
9
+ return moment(value).utc().format('YYYY-MM-DD HH:mm:ss');
10
10
  };
11
11
  DateTransformer.prototype.from = function (value) {
12
- return moment.utc(value).tz('America/Bogota').format('YYYY-MM-DD HH:mm:ss'); // Convierte de UTC a la zona horaria local al recuperar de la base de datos
12
+ return moment.utc(value).tz('America/Bogota').format('YYYY-MM-DD HH:mm:ss');
13
13
  };
14
14
  return DateTransformer;
15
15
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "1.7.7",
3
+ "version": "1.7.8",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,10 +3,10 @@ import * as moment from 'moment-timezone'
3
3
 
4
4
  export class DateTransformer implements ValueTransformer {
5
5
  to(value: string): string {
6
- return value // Deja la fecha en UTC al guardar en la base de datos
6
+ return moment(value).utc().format('YYYY-MM-DD HH:mm:ss')
7
7
  }
8
8
 
9
9
  from(value: string): string {
10
- return moment.utc(value).tz('America/Bogota').format('YYYY-MM-DD HH:mm:ss') // Convierte de UTC a la zona horaria local al recuperar de la base de datos
10
+ return moment.utc(value).tz('America/Bogota').format('YYYY-MM-DD HH:mm:ss')
11
11
  }
12
12
  }