wsp-ms-core 1.1.13 → 1.1.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.
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -242,6 +242,13 @@ var _DateTime = class _DateTime extends ValueObject {
|
|
|
242
242
|
value: this.value
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
+
formatInTimezone(timezone) {
|
|
246
|
+
const zoned = this._dt.setZone(timezone);
|
|
247
|
+
if (!zoned.isValid) {
|
|
248
|
+
throw new Error(`Invalid timezone: ${timezone}`);
|
|
249
|
+
}
|
|
250
|
+
return zoned.toFormat(_DateTime.DEFAULT_FORMAT);
|
|
251
|
+
}
|
|
245
252
|
static create(input) {
|
|
246
253
|
if (input === void 0) {
|
|
247
254
|
return new _DateTime(_DateTime.toUtcFormat(import_luxon.DateTime.now()));
|
|
@@ -269,6 +276,8 @@ _DateTime.FORMAT_Y_M_D_H_m_s = "Y-M-D H:M:S";
|
|
|
269
276
|
_DateTime.FORMAT_D_M_Y = "D-M-Y";
|
|
270
277
|
_DateTime.COMPARE_UNIT_MILLIS = "millis";
|
|
271
278
|
_DateTime.COMPARE_UNIT_DAY = "day";
|
|
279
|
+
_DateTime.TIMEZONE_UTC = "utc";
|
|
280
|
+
_DateTime.TIMEZONE_URUGUAY = "America/Montevideo";
|
|
272
281
|
_DateTime.FORMATS = {
|
|
273
282
|
"Y-M": "yyyy-MM",
|
|
274
283
|
"Y-M-D": "yyyy-MM-dd",
|