@syncfusion/ej2-calendars 20.4.44 → 20.4.48

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.
@@ -3285,7 +3285,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3285
3285
  this.createInput();
3286
3286
  this.updateHtmlAttributeToWrapper();
3287
3287
  this.setAllowEdit();
3288
- this.updateInput();
3288
+ this.updateInput(true);
3289
3289
  if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
3290
3290
  this.updateInputValue(this.maskedDateValue);
3291
3291
  }
@@ -3347,8 +3347,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3347
3347
  DatePicker.prototype.updateInput = function (isDynamic) {
3348
3348
  if (isDynamic === void 0) { isDynamic = false; }
3349
3349
  var formatOptions;
3350
- if (this.value && !this.isCalendar() && !isDynamic) {
3351
- this.disabledDates();
3350
+ if (this.value && !this.isCalendar()) {
3351
+ this.disabledDates(isDynamic);
3352
3352
  }
3353
3353
  if (isNaN(+new Date(this.checkValue(this.value)))) {
3354
3354
  this.setProperties({ value: null }, true);
@@ -4782,14 +4782,17 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4782
4782
  DatePicker.prototype.getModuleName = function () {
4783
4783
  return 'datepicker';
4784
4784
  };
4785
- DatePicker.prototype.disabledDates = function () {
4785
+ DatePicker.prototype.disabledDates = function (isDynamic) {
4786
+ if (isDynamic === void 0) { isDynamic = false; }
4786
4787
  var formatOptions;
4787
4788
  var globalize;
4788
4789
  var valueCopy = this.checkDateValue(this.value) ? new Date(+this.value) : new Date(this.checkValue(this.value));
4789
4790
  var previousValCopy = this.previousDate;
4790
4791
  //calls the Calendar render method to check the disabled dates through renderDayCell event and update the input value accordingly.
4791
4792
  this.minMaxUpdates();
4792
- _super.prototype.render.call(this);
4793
+ if (!isDynamic || (isDynamic && !isNullOrUndefined(this.renderDayCell))) {
4794
+ _super.prototype.render.call(this);
4795
+ }
4793
4796
  this.previousDate = previousValCopy;
4794
4797
  var date = valueCopy && +(valueCopy);
4795
4798
  var dateIdString = '*[id^="/id"]'.replace('/id', '' + date);
@@ -4798,7 +4801,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4798
4801
  this.setProperties({ value: valueCopy }, true);
4799
4802
  }
4800
4803
  }
4801
- if (!isNullOrUndefined(this.calendarElement.querySelectorAll(dateIdString)[0])) {
4804
+ if (!isNullOrUndefined(this.calendarElement) && !isNullOrUndefined(this.calendarElement.querySelectorAll(dateIdString)[0])) {
4802
4805
  if (this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled')) {
4803
4806
  if (!this.strictMode) {
4804
4807
  this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
@@ -4859,8 +4862,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4859
4862
  var isDisabledDate = this.calendarElement &&
4860
4863
  this.calendarElement.querySelectorAll(dateIdString)[0] &&
4861
4864
  this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled');
4862
- if ((!isNullOrUndefined(this.value) && !(+new Date(+this.value).setMilliseconds(0) >= +this.min
4863
- && +new Date(+this.value).setMilliseconds(0) <= +this.max))
4865
+ if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) && !isNullOrUndefined(this.max) && !(new Date(this.value).setMilliseconds(0) >= new Date(this.min).setMilliseconds(0)
4866
+ && new Date(this.value).setMilliseconds(0) <= new Date(this.max).setMilliseconds(0)))
4864
4867
  || (!this.strictMode && this.inputElement.value !== '' && this.inputElement.value !== this.maskedDateValue && isNullOrUndefined(this.value) || isDisabledDate)) {
4865
4868
  addClass([this.inputWrapper.container], ERROR);
4866
4869
  attributes(this.inputElement, { 'aria-invalid': 'true' });
@@ -5904,7 +5907,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
5904
5907
  this.createControl();
5905
5908
  this.bindCalendarEvents();
5906
5909
  this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
5907
- if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.renderDayCell)) {
5910
+ if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
5908
5911
  this.disabledDateRender();
5909
5912
  }
5910
5913
  this.updateHeader();
@@ -6921,7 +6924,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
6921
6924
  if (!this.isMobile) {
6922
6925
  this.removeClassDisabled();
6923
6926
  }
6924
- if (!isNullOrUndefined(this.renderDayCell)) {
6927
+ if (!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
6925
6928
  this.disabledDateRender();
6926
6929
  }
6927
6930
  this.trigger('select', this.rangeArgs(event));
@@ -8499,7 +8502,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8499
8502
  if (!this.strictMode && (isDisabled)) {
8500
8503
  this.clearRange();
8501
8504
  }
8502
- if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isDisabled && !isNullOrUndefined(this.renderDayCell)) {
8505
+ if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isDisabled && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
8503
8506
  this.disabledDateRender();
8504
8507
  }
8505
8508
  this.errorClass();
@@ -8992,7 +8995,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8992
8995
  if (!isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.endValue)) {
8993
8996
  range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
8994
8997
  this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
8995
- if (!isNullOrUndefined(this.renderDayCell)) {
8998
+ if (!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
8996
8999
  this.disabledDateRender();
8997
9000
  }
8998
9001
  if (!isNullOrUndefined(this.disabledDayCnt)) {
@@ -12355,7 +12358,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
12355
12358
  module: "MaskedDateTime",
12356
12359
  });
12357
12360
  }
12358
- this.setValue();
12361
+ this.setValue(true);
12359
12362
  if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
12360
12363
  Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
12361
12364
  }
@@ -12374,7 +12377,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
12374
12377
  }
12375
12378
  this.renderComplete();
12376
12379
  };
12377
- DateTimePicker.prototype.setValue = function () {
12380
+ DateTimePicker.prototype.setValue = function (isDynamic) {
12381
+ if (isDynamic === void 0) { isDynamic = false; }
12378
12382
  this.initValue = this.validateMinMaxRange(this.value);
12379
12383
  if (!this.strictMode && this.isDateObject(this.initValue)) {
12380
12384
  var value = this.validateMinMaxRange(this.initValue);
@@ -12388,7 +12392,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
12388
12392
  }
12389
12393
  }
12390
12394
  this.valueWithMinutes = this.value;
12391
- _super.prototype.updateInput.call(this);
12395
+ _super.prototype.updateInput.call(this, isDynamic);
12392
12396
  };
12393
12397
  DateTimePicker.prototype.validateMinMaxRange = function (value) {
12394
12398
  var result = value;