test-entity-library-asm 2.4.2 → 2.4.4

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.
@@ -11,7 +11,7 @@ export declare class DiscountCodeUser {
11
11
  type: number;
12
12
  single_use: number;
13
13
  created: Date;
14
- expiration: Date;
14
+ expiration: string;
15
15
  updated_by: Partner;
16
16
  updated: Date;
17
17
  status: number;
@@ -73,11 +73,9 @@ var DiscountCodeUser = /** @class */ (function () {
73
73
  ], DiscountCodeUser.prototype, "created", void 0);
74
74
  __decorate([
75
75
  (0, typeorm_1.Column)({
76
- type: 'date',
77
- transformer: new dateTransformer_1.DateTransformer(),
78
76
  comment: 'Fecha de expiración del registro.',
79
77
  }),
80
- __metadata("design:type", Date)
78
+ __metadata("design:type", String)
81
79
  ], DiscountCodeUser.prototype, "expiration", void 0);
82
80
  __decorate([
83
81
  (0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.discount_code_partners; }, {
@@ -1,5 +1,5 @@
1
1
  import { ValueTransformer } from 'typeorm';
2
2
  export declare class DateTransformer implements ValueTransformer {
3
- to(value: Date | string): string;
3
+ to(value: any): string;
4
4
  from(value: string): string;
5
5
  }
@@ -7,7 +7,7 @@ var DateTransformer = /** @class */ (function () {
7
7
  function DateTransformer() {
8
8
  }
9
9
  DateTransformer.prototype.to = function (value) {
10
- return moment.utc(value).format('YYYY-MM-DD HH:mm:ss');
10
+ return value;
11
11
  };
12
12
  DateTransformer.prototype.from = function (value) {
13
13
  return moment.utc(value).tz((0, __1.getTimeZone)()).format('YYYY-MM-DD HH:mm:ss');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -63,11 +63,9 @@ export class DiscountCodeUser {
63
63
  created: Date
64
64
 
65
65
  @Column({
66
- type: 'date',
67
- transformer: new DateTransformer(),
68
66
  comment: 'Fecha de expiración del registro.',
69
67
  })
70
- expiration: Date
68
+ expiration: string
71
69
 
72
70
  @ManyToOne(() => Partner, (partner) => partner.discount_code_partners, {
73
71
  onDelete: 'CASCADE',
@@ -3,8 +3,8 @@ import * as moment from 'moment-timezone'
3
3
  import { getTimeZone } from '..'
4
4
 
5
5
  export class DateTransformer implements ValueTransformer {
6
- to(value: Date | string): string {
7
- return moment.utc(value).format('YYYY-MM-DD HH:mm:ss')
6
+ to(value: any): string {
7
+ return value
8
8
  }
9
9
 
10
10
  from(value: string): string {