test-entity-library-asm 3.9.15 → 3.9.17
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.
|
@@ -7,19 +7,15 @@ exports.DateTransformer = void 0;
|
|
|
7
7
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
8
8
|
const __1 = require("..");
|
|
9
9
|
class DateTransformer {
|
|
10
|
-
// Cuando guardamos en DB
|
|
11
10
|
to(value) {
|
|
12
|
-
|
|
13
|
-
return
|
|
11
|
+
const result = (0, moment_timezone_1.default)(value).format("YYYY-MM-DD HH:mm:ss");
|
|
12
|
+
return result;
|
|
14
13
|
}
|
|
15
|
-
// Cuando leemos de DB
|
|
16
14
|
from(value) {
|
|
17
|
-
if (
|
|
15
|
+
if (value === null)
|
|
18
16
|
return null;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const m = moment_timezone_1.default.tz(value, "YYYY-MM-DD HH:mm:ss", "UTC").tz(tz, true);
|
|
22
|
-
return m.toDate();
|
|
17
|
+
const result = moment_timezone_1.default.utc(value).tz((0, __1.getTimeZone)()).toDate();
|
|
18
|
+
return result;
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
21
|
exports.DateTransformer = DateTransformer;
|
package/package.json
CHANGED
package/src/entities/Local.ts
CHANGED
|
@@ -168,7 +168,7 @@ export class Local {
|
|
|
168
168
|
|
|
169
169
|
@OneToMany(
|
|
170
170
|
() => LocalQualification,
|
|
171
|
-
(localQualification) => localQualification.local
|
|
171
|
+
(localQualification) => localQualification.local,
|
|
172
172
|
)
|
|
173
173
|
qualifications: LocalQualification[];
|
|
174
174
|
|
|
@@ -188,7 +188,7 @@ export class Local {
|
|
|
188
188
|
|
|
189
189
|
@ManyToMany(
|
|
190
190
|
() => BusinessTypeProduct,
|
|
191
|
-
(businessTypeProduct) => businessTypeProduct.business_type_products
|
|
191
|
+
(businessTypeProduct) => businessTypeProduct.business_type_products,
|
|
192
192
|
)
|
|
193
193
|
@JoinTable({
|
|
194
194
|
name: "business_type_product_local",
|
|
@@ -205,7 +205,7 @@ export class Local {
|
|
|
205
205
|
|
|
206
206
|
@OneToMany(
|
|
207
207
|
() => DiscountCodeUser,
|
|
208
|
-
(discountCodeUser) => discountCodeUser.local
|
|
208
|
+
(discountCodeUser) => discountCodeUser.local,
|
|
209
209
|
)
|
|
210
210
|
discount_code_locals: DiscountCodeUser[];
|
|
211
211
|
|
|
@@ -223,13 +223,13 @@ export class Local {
|
|
|
223
223
|
|
|
224
224
|
@OneToMany(
|
|
225
225
|
() => LocalDecorationReserve,
|
|
226
|
-
(localDecorationReserve) => localDecorationReserve.local
|
|
226
|
+
(localDecorationReserve) => localDecorationReserve.local,
|
|
227
227
|
)
|
|
228
228
|
local_decorations_reserve: LocalDecorationReserve[];
|
|
229
229
|
|
|
230
230
|
@OneToMany(
|
|
231
231
|
() => LocalReserveStatus,
|
|
232
|
-
(localReserveStatus) => localReserveStatus.local
|
|
232
|
+
(localReserveStatus) => localReserveStatus.local,
|
|
233
233
|
)
|
|
234
234
|
local_reserve_status: LocalReserveStatus[];
|
|
235
235
|
|
|
@@ -241,7 +241,7 @@ export class Local {
|
|
|
241
241
|
|
|
242
242
|
@OneToMany(
|
|
243
243
|
() => LocalPaymentMethod,
|
|
244
|
-
(localPaymentMethod) => localPaymentMethod.local
|
|
244
|
+
(localPaymentMethod) => localPaymentMethod.local,
|
|
245
245
|
)
|
|
246
246
|
locals_payment_method: LocalPaymentMethod[];
|
|
247
247
|
}
|
|
@@ -3,19 +3,15 @@ import moment from "moment-timezone";
|
|
|
3
3
|
import { getTimeZone } from "..";
|
|
4
4
|
|
|
5
5
|
export class DateTransformer implements ValueTransformer {
|
|
6
|
-
// Cuando guardamos en DB
|
|
7
6
|
to(value: Date | string): string {
|
|
8
|
-
|
|
9
|
-
return
|
|
7
|
+
const result = moment(value).format("YYYY-MM-DD HH:mm:ss");
|
|
8
|
+
return result;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!value) return null;
|
|
11
|
+
from(value: string): Date | null | string {
|
|
12
|
+
if (value === null) return null;
|
|
15
13
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const m = moment.tz(value, "YYYY-MM-DD HH:mm:ss", "UTC").tz(tz, true);
|
|
19
|
-
return m.toDate();
|
|
14
|
+
const result = moment.utc(value).tz(getTimeZone()).toDate();
|
|
15
|
+
return result;
|
|
20
16
|
}
|
|
21
17
|
}
|