@syncfusion/ej2-calendars 31.2.5 → 31.2.12

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.
@@ -3383,6 +3383,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3383
3383
  if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
3384
3384
  this.enabled = false;
3385
3385
  }
3386
+ this.initTimeZone = new Date().getTimezoneOffset();
3386
3387
  this.renderComplete();
3387
3388
  this.setTimeZone(this.serverTimezoneOffset);
3388
3389
  };
@@ -3960,6 +3961,9 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3960
3961
  if (!this.enabled) {
3961
3962
  return;
3962
3963
  }
3964
+ if (this.initTimeZone !== new Date().getTimezoneOffset()) {
3965
+ this.strictModeUpdate(true);
3966
+ }
3963
3967
  if (this.enableMask && !this.inputElement.value && this.placeholder) {
3964
3968
  if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
3965
3969
  this.updateInputValue(this.maskedDateValue);
@@ -3997,12 +4001,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3997
4001
  }
3998
4002
  };
3999
4003
  DatePicker.prototype.inputBlurHandler = function (e) {
4000
- var inputSame = this.inputElement.value === this.previousElementValue;
4001
- var dateSame = this.value && this.previousDate
4002
- ? this.value.getTime() === this.previousDate.getTime()
4003
- : this.value === this.previousDate;
4004
4004
  this.updateFloatLabelOverflowWidth();
4005
- if (!this.enabled || (inputSame && dateSame)) {
4005
+ if (!this.enabled) {
4006
4006
  return;
4007
4007
  }
4008
4008
  this.strictModeUpdate();
@@ -4186,7 +4186,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4186
4186
  }
4187
4187
  }
4188
4188
  };
4189
- DatePicker.prototype.strictModeUpdate = function () {
4189
+ DatePicker.prototype.strictModeUpdate = function (preventTimeZone) {
4190
4190
  var format;
4191
4191
  var pattern = /^y/;
4192
4192
  var charPattern = /[^a-zA-Z]/;
@@ -4293,17 +4293,17 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4293
4293
  }
4294
4294
  }
4295
4295
  // EJ2-35061 - To prevent change event from triggering twice when using strictmode and format property
4296
- if ((this.getModuleName() === 'datepicker') && (this.value && !isNaN(+this.value)) && date) {
4296
+ if (((this.getModuleName() === 'datepicker') && (this.value && !isNaN(+this.value)) && date) && !preventTimeZone) {
4297
4297
  date.setHours(this.value.getHours(), this.value.getMinutes(), this.value.getSeconds(), this.value.getMilliseconds());
4298
4298
  }
4299
4299
  if (this.strictMode && date) {
4300
4300
  this.updateInputValue(this.globalize.formatDate(date, dateOptions));
4301
- if (this.inputElement.value !== this.previousElementValue) {
4301
+ if ((this.inputElement.value !== this.previousElementValue) || preventTimeZone) {
4302
4302
  this.setProperties({ value: date }, true);
4303
4303
  }
4304
4304
  }
4305
4305
  else if (!this.strictMode) {
4306
- if (this.inputElement.value !== this.previousElementValue) {
4306
+ if ((this.inputElement.value !== this.previousElementValue) || preventTimeZone) {
4307
4307
  this.setProperties({ value: date }, true);
4308
4308
  }
4309
4309
  }
@@ -4486,11 +4486,14 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4486
4486
  if (this.fullScreenMode) {
4487
4487
  var modelCloseIcon = this.createElement('span', { className: 'e-popup-close' });
4488
4488
  EventHandler.add(modelCloseIcon, 'mousedown touchstart', this.modelCloseHandler, this);
4489
- var modelTodayButton = this.calendarElement.querySelector('button.e-today');
4489
+ var modelTodayButton = this.showTodayButton
4490
+ ? this.calendarElement.querySelector('button.e-today') : null;
4490
4491
  h2.classList.add('e-day-wrapper');
4491
- modelTodayButton.classList.add('e-outline');
4492
4492
  modelHeader.appendChild(modelCloseIcon);
4493
- modelHeader.appendChild(modelTodayButton);
4493
+ if (modelTodayButton) {
4494
+ modelTodayButton.classList.add('e-outline');
4495
+ modelHeader.appendChild(modelTodayButton);
4496
+ }
4494
4497
  }
4495
4498
  if (!this.fullScreenMode) {
4496
4499
  modelHeader.appendChild(yearHeading);