myrta-ui 1.1.92 → 1.1.93
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/esm2020/lib/components/form/input-date-time/input-date-time.component.mjs +13 -31
- package/fesm2015/myrta-ui.mjs +12 -30
- package/fesm2015/myrta-ui.mjs.map +1 -1
- package/fesm2020/myrta-ui.mjs +12 -30
- package/fesm2020/myrta-ui.mjs.map +1 -1
- package/lib/components/form/input-date-time/input-date-time.component.d.ts +0 -2
- package/package.json +1 -1
package/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -10338,7 +10338,12 @@ class InputDateTimeComponent {
|
|
|
10338
10338
|
if (this.dt) {
|
|
10339
10339
|
if (changes['maxDate']) {
|
|
10340
10340
|
this.dt.update({ maxDate: this.maxDate });
|
|
10341
|
-
|
|
10341
|
+
if (this.value) {
|
|
10342
|
+
this.dt.selectDate(formattingFromModels(this.dateModel, this.timeModel, this.timepicker).toISOString(), {
|
|
10343
|
+
updateTime: this.timepicker,
|
|
10344
|
+
silent: true
|
|
10345
|
+
});
|
|
10346
|
+
}
|
|
10342
10347
|
if (!this.disableValidate) {
|
|
10343
10348
|
const invalid = this.innerInvalid;
|
|
10344
10349
|
const isValid = this.checkingInvalid(this.value, this.maxDate, this.minDate);
|
|
@@ -10351,7 +10356,12 @@ class InputDateTimeComponent {
|
|
|
10351
10356
|
}
|
|
10352
10357
|
if (changes['minDate']) {
|
|
10353
10358
|
this.dt.update({ minDate: this.minDate });
|
|
10354
|
-
|
|
10359
|
+
if (this.value) {
|
|
10360
|
+
this.dt.selectDate(formattingFromModels(this.dateModel, this.timeModel, this.timepicker).toISOString(), {
|
|
10361
|
+
updateTime: this.timepicker,
|
|
10362
|
+
silent: true
|
|
10363
|
+
});
|
|
10364
|
+
}
|
|
10355
10365
|
if (!this.disableValidate) {
|
|
10356
10366
|
const invalid = this.innerInvalid;
|
|
10357
10367
|
const isValid = this.checkingInvalid(this.value, this.maxDate, this.minDate);
|
|
@@ -10384,26 +10394,6 @@ class InputDateTimeComponent {
|
|
|
10384
10394
|
return this.checkInvalid === false ? 'mrx-input-checked-success' : this.checkInvalid === true ? 'mrx-input-checked-error' : '';
|
|
10385
10395
|
}
|
|
10386
10396
|
}
|
|
10387
|
-
_getDateFromTimezone(date) {
|
|
10388
|
-
if (!date) {
|
|
10389
|
-
return date;
|
|
10390
|
-
}
|
|
10391
|
-
if (this.timezone !== 'default') {
|
|
10392
|
-
const utcTime = dayjs.utc(date);
|
|
10393
|
-
const localOffsetMinutes = dayjs().utcOffset();
|
|
10394
|
-
const moscowOffsetMinutes = dayjs().tz(this.timezone).utcOffset();
|
|
10395
|
-
const offsetDifferenceMinutes = localOffsetMinutes - moscowOffsetMinutes;
|
|
10396
|
-
if (offsetDifferenceMinutes >= 0) {
|
|
10397
|
-
return utcTime.subtract(offsetDifferenceMinutes, 'minute').toISOString();
|
|
10398
|
-
}
|
|
10399
|
-
else {
|
|
10400
|
-
return utcTime.add(Math.abs(offsetDifferenceMinutes), 'minute').toISOString();
|
|
10401
|
-
}
|
|
10402
|
-
}
|
|
10403
|
-
else {
|
|
10404
|
-
return date;
|
|
10405
|
-
}
|
|
10406
|
-
}
|
|
10407
10397
|
_checkExtraTime() {
|
|
10408
10398
|
if (this.addMaxTime && !this.timepicker) {
|
|
10409
10399
|
this.timeModel.hour = '23';
|
|
@@ -10454,14 +10444,6 @@ class InputDateTimeComponent {
|
|
|
10454
10444
|
}
|
|
10455
10445
|
}
|
|
10456
10446
|
}
|
|
10457
|
-
dateFormattingOutput(value) {
|
|
10458
|
-
if (value) {
|
|
10459
|
-
return dayjs(value).toISOString();
|
|
10460
|
-
}
|
|
10461
|
-
else {
|
|
10462
|
-
return '';
|
|
10463
|
-
}
|
|
10464
|
-
}
|
|
10465
10447
|
invalidMessageOn(message) {
|
|
10466
10448
|
this.innerInvalid = true;
|
|
10467
10449
|
this.innerInvalidMessage = message;
|