@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.
@@ -3344,6 +3344,7 @@ let DatePicker = class DatePicker extends Calendar {
3344
3344
  if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
3345
3345
  this.enabled = false;
3346
3346
  }
3347
+ this.initTimeZone = new Date().getTimezoneOffset();
3347
3348
  this.renderComplete();
3348
3349
  this.setTimeZone(this.serverTimezoneOffset);
3349
3350
  }
@@ -3917,6 +3918,9 @@ let DatePicker = class DatePicker extends Calendar {
3917
3918
  if (!this.enabled) {
3918
3919
  return;
3919
3920
  }
3921
+ if (this.initTimeZone !== new Date().getTimezoneOffset()) {
3922
+ this.strictModeUpdate(true);
3923
+ }
3920
3924
  if (this.enableMask && !this.inputElement.value && this.placeholder) {
3921
3925
  if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
3922
3926
  this.updateInputValue(this.maskedDateValue);
@@ -3954,12 +3958,8 @@ let DatePicker = class DatePicker extends Calendar {
3954
3958
  }
3955
3959
  }
3956
3960
  inputBlurHandler(e) {
3957
- const inputSame = this.inputElement.value === this.previousElementValue;
3958
- const dateSame = this.value && this.previousDate
3959
- ? this.value.getTime() === this.previousDate.getTime()
3960
- : this.value === this.previousDate;
3961
3961
  this.updateFloatLabelOverflowWidth();
3962
- if (!this.enabled || (inputSame && dateSame)) {
3962
+ if (!this.enabled) {
3963
3963
  return;
3964
3964
  }
3965
3965
  this.strictModeUpdate();
@@ -4143,7 +4143,7 @@ let DatePicker = class DatePicker extends Calendar {
4143
4143
  }
4144
4144
  }
4145
4145
  }
4146
- strictModeUpdate() {
4146
+ strictModeUpdate(preventTimeZone) {
4147
4147
  let format;
4148
4148
  const pattern = /^y/;
4149
4149
  const charPattern = /[^a-zA-Z]/;
@@ -4248,17 +4248,17 @@ let DatePicker = class DatePicker extends Calendar {
4248
4248
  }
4249
4249
  }
4250
4250
  // EJ2-35061 - To prevent change event from triggering twice when using strictmode and format property
4251
- if ((this.getModuleName() === 'datepicker') && (this.value && !isNaN(+this.value)) && date) {
4251
+ if (((this.getModuleName() === 'datepicker') && (this.value && !isNaN(+this.value)) && date) && !preventTimeZone) {
4252
4252
  date.setHours(this.value.getHours(), this.value.getMinutes(), this.value.getSeconds(), this.value.getMilliseconds());
4253
4253
  }
4254
4254
  if (this.strictMode && date) {
4255
4255
  this.updateInputValue(this.globalize.formatDate(date, dateOptions));
4256
- if (this.inputElement.value !== this.previousElementValue) {
4256
+ if ((this.inputElement.value !== this.previousElementValue) || preventTimeZone) {
4257
4257
  this.setProperties({ value: date }, true);
4258
4258
  }
4259
4259
  }
4260
4260
  else if (!this.strictMode) {
4261
- if (this.inputElement.value !== this.previousElementValue) {
4261
+ if ((this.inputElement.value !== this.previousElementValue) || preventTimeZone) {
4262
4262
  this.setProperties({ value: date }, true);
4263
4263
  }
4264
4264
  }
@@ -4440,11 +4440,14 @@ let DatePicker = class DatePicker extends Calendar {
4440
4440
  if (this.fullScreenMode) {
4441
4441
  const modelCloseIcon = this.createElement('span', { className: 'e-popup-close' });
4442
4442
  EventHandler.add(modelCloseIcon, 'mousedown touchstart', this.modelCloseHandler, this);
4443
- const modelTodayButton = this.calendarElement.querySelector('button.e-today');
4443
+ const modelTodayButton = this.showTodayButton
4444
+ ? this.calendarElement.querySelector('button.e-today') : null;
4444
4445
  h2.classList.add('e-day-wrapper');
4445
- modelTodayButton.classList.add('e-outline');
4446
4446
  modelHeader.appendChild(modelCloseIcon);
4447
- modelHeader.appendChild(modelTodayButton);
4447
+ if (modelTodayButton) {
4448
+ modelTodayButton.classList.add('e-outline');
4449
+ modelHeader.appendChild(modelTodayButton);
4450
+ }
4448
4451
  }
4449
4452
  if (!this.fullScreenMode) {
4450
4453
  modelHeader.appendChild(yearHeading);