test-entity-library-asm 1.7.4 → 1.7.5
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.
|
@@ -10,10 +10,16 @@ var DateTransformer = /** @class */ (function () {
|
|
|
10
10
|
}
|
|
11
11
|
DateTransformer.prototype.from = function (value) {
|
|
12
12
|
var timeZone = (0, __1.getTimeZone)();
|
|
13
|
+
console.log("Converting ".concat(value, " from UTC to ").concat(timeZone));
|
|
13
14
|
var zonedDate = (0, date_fns_tz_1.toZonedTime)(value, timeZone);
|
|
15
|
+
console.log("Converted date: ".concat(zonedDate));
|
|
16
|
+
console.log("Formatted date than return: ".concat((0, date_fns_tz_1.format)(zonedDate, this.format, {
|
|
17
|
+
timeZone: timeZone,
|
|
18
|
+
})));
|
|
14
19
|
return (0, date_fns_tz_1.format)(zonedDate, this.format, { timeZone: timeZone });
|
|
15
20
|
};
|
|
16
21
|
DateTransformer.prototype.to = function (value) {
|
|
22
|
+
console.log("Converting ".concat(value, " to UTC"));
|
|
17
23
|
return new Date(value); // Assuming the input is already in UTC
|
|
18
24
|
};
|
|
19
25
|
return DateTransformer;
|
package/package.json
CHANGED
|
@@ -12,11 +12,21 @@ export class DateTransformer implements ValueTransformer {
|
|
|
12
12
|
|
|
13
13
|
from(value: Date): string {
|
|
14
14
|
const timeZone = getTimeZone()
|
|
15
|
+
console.log(`Converting ${value} from UTC to ${timeZone}`)
|
|
15
16
|
const zonedDate = toZonedTime(value, timeZone)
|
|
17
|
+
console.log(`Converted date: ${zonedDate}`)
|
|
18
|
+
console.log(
|
|
19
|
+
`Formatted date than return: ${format(zonedDate, this.format, {
|
|
20
|
+
timeZone,
|
|
21
|
+
})}`
|
|
22
|
+
)
|
|
23
|
+
|
|
16
24
|
return format(zonedDate, this.format, { timeZone })
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
to(value: Date): Date {
|
|
28
|
+
console.log(`Converting ${value} to UTC`)
|
|
29
|
+
|
|
20
30
|
return new Date(value) // Assuming the input is already in UTC
|
|
21
31
|
}
|
|
22
32
|
}
|