@syncfusion/ej2-calendars 20.4.42 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.42
3
+ * version : 20.4.48
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-calendars@*",
3
- "_id": "@syncfusion/ej2-calendars@20.4.40",
3
+ "_id": "@syncfusion/ej2-calendars@20.4.44",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-dIUZC7yf+bdh19falIrE12r92V+I3kJInBNOzF4J1LLrV+oHfWG8KIRdivjb5FAj0C48vtZR2BxBGk5Lc1+9xQ==",
5
+ "_integrity": "sha512-lPyLD/lhi38bHc+9j4Gxo3NT8UHOVrdv/Ia9Ta7wDIHKjp2Wgm1TO/yUOatKJ99F8H24jtdqhVyvrOU1NjjWTw==",
6
6
  "_location": "/@syncfusion/ej2-calendars",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -32,8 +32,8 @@
32
32
  "/@syncfusion/ej2-schedule",
33
33
  "/@syncfusion/ej2-vue-calendars"
34
34
  ],
35
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-calendars/-/ej2-calendars-20.4.40.tgz",
36
- "_shasum": "c3e55dd97a1ae5b1c564063fb714aa1102a48b34",
35
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-calendars/-/ej2-calendars-20.4.44.tgz",
36
+ "_shasum": "edb94ca0fd4fb86a6c64accd05e956ad9761afd2",
37
37
  "_spec": "@syncfusion/ej2-calendars@*",
38
38
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
39
39
  "author": {
@@ -44,11 +44,11 @@
44
44
  },
45
45
  "bundleDependencies": false,
46
46
  "dependencies": {
47
- "@syncfusion/ej2-base": "~20.4.42",
48
- "@syncfusion/ej2-buttons": "~20.4.42",
49
- "@syncfusion/ej2-inputs": "~20.4.42",
50
- "@syncfusion/ej2-lists": "~20.4.42",
51
- "@syncfusion/ej2-popups": "~20.4.42"
47
+ "@syncfusion/ej2-base": "~20.4.48",
48
+ "@syncfusion/ej2-buttons": "~20.4.48",
49
+ "@syncfusion/ej2-inputs": "~20.4.48",
50
+ "@syncfusion/ej2-lists": "~20.4.48",
51
+ "@syncfusion/ej2-popups": "~20.4.48"
52
52
  },
53
53
  "deprecated": false,
54
54
  "description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
@@ -81,6 +81,6 @@
81
81
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
82
82
  },
83
83
  "typings": "index.d.ts",
84
- "version": "20.4.42",
84
+ "version": "20.4.48",
85
85
  "sideEffects": false
86
86
  }
@@ -157,7 +157,7 @@ var DatePicker = /** @class */ (function (_super) {
157
157
  this.createInput();
158
158
  this.updateHtmlAttributeToWrapper();
159
159
  this.setAllowEdit();
160
- this.updateInput();
160
+ this.updateInput(true);
161
161
  if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
162
162
  this.updateInputValue(this.maskedDateValue);
163
163
  }
@@ -219,8 +219,8 @@ var DatePicker = /** @class */ (function (_super) {
219
219
  DatePicker.prototype.updateInput = function (isDynamic) {
220
220
  if (isDynamic === void 0) { isDynamic = false; }
221
221
  var formatOptions;
222
- if (this.value && !this.isCalendar() && !isDynamic) {
223
- this.disabledDates();
222
+ if (this.value && !this.isCalendar()) {
223
+ this.disabledDates(isDynamic);
224
224
  }
225
225
  if (isNaN(+new Date(this.checkValue(this.value)))) {
226
226
  this.setProperties({ value: null }, true);
@@ -1654,14 +1654,17 @@ var DatePicker = /** @class */ (function (_super) {
1654
1654
  DatePicker.prototype.getModuleName = function () {
1655
1655
  return 'datepicker';
1656
1656
  };
1657
- DatePicker.prototype.disabledDates = function () {
1657
+ DatePicker.prototype.disabledDates = function (isDynamic) {
1658
+ if (isDynamic === void 0) { isDynamic = false; }
1658
1659
  var formatOptions;
1659
1660
  var globalize;
1660
1661
  var valueCopy = this.checkDateValue(this.value) ? new Date(+this.value) : new Date(this.checkValue(this.value));
1661
1662
  var previousValCopy = this.previousDate;
1662
1663
  //calls the Calendar render method to check the disabled dates through renderDayCell event and update the input value accordingly.
1663
1664
  this.minMaxUpdates();
1664
- _super.prototype.render.call(this);
1665
+ if (!isDynamic || (isDynamic && !isNullOrUndefined(this.renderDayCell))) {
1666
+ _super.prototype.render.call(this);
1667
+ }
1665
1668
  this.previousDate = previousValCopy;
1666
1669
  var date = valueCopy && +(valueCopy);
1667
1670
  var dateIdString = '*[id^="/id"]'.replace('/id', '' + date);
@@ -1670,7 +1673,7 @@ var DatePicker = /** @class */ (function (_super) {
1670
1673
  this.setProperties({ value: valueCopy }, true);
1671
1674
  }
1672
1675
  }
1673
- if (!isNullOrUndefined(this.calendarElement.querySelectorAll(dateIdString)[0])) {
1676
+ if (!isNullOrUndefined(this.calendarElement) && !isNullOrUndefined(this.calendarElement.querySelectorAll(dateIdString)[0])) {
1674
1677
  if (this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled')) {
1675
1678
  if (!this.strictMode) {
1676
1679
  this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
@@ -1731,8 +1734,8 @@ var DatePicker = /** @class */ (function (_super) {
1731
1734
  var isDisabledDate = this.calendarElement &&
1732
1735
  this.calendarElement.querySelectorAll(dateIdString)[0] &&
1733
1736
  this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled');
1734
- if ((!isNullOrUndefined(this.value) && !(+new Date(+this.value).setMilliseconds(0) >= +this.min
1735
- && +new Date(+this.value).setMilliseconds(0) <= +this.max))
1737
+ if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) && !isNullOrUndefined(this.max) && !(new Date(this.value).setMilliseconds(0) >= new Date(this.min).setMilliseconds(0)
1738
+ && new Date(this.value).setMilliseconds(0) <= new Date(this.max).setMilliseconds(0)))
1736
1739
  || (!this.strictMode && this.inputElement.value !== '' && this.inputElement.value !== this.maskedDateValue && isNullOrUndefined(this.value) || isDisabledDate)) {
1737
1740
  addClass([this.inputWrapper.container], ERROR);
1738
1741
  attributes(this.inputElement, { 'aria-invalid': 'true' });
@@ -638,6 +638,7 @@ export declare class DateRangePicker extends CalendarBase {
638
638
  private deviceHeaderClick;
639
639
  private inputFocusHandler;
640
640
  private inputBlurHandler;
641
+ private getStartEndDate;
641
642
  private clearRange;
642
643
  private errorClass;
643
644
  private keyCalendarUpdate;
@@ -820,6 +821,7 @@ export declare class DateRangePicker extends CalendarBase {
820
821
  private clearModelvalue;
821
822
  private createHiddenInput;
822
823
  private setMinMaxDays;
824
+ private getStartEndValue;
823
825
  /**
824
826
  * Called internally if any of the property value changed.
825
827
  *
@@ -804,7 +804,7 @@ var DateRangePicker = /** @class */ (function (_super) {
804
804
  this.createControl();
805
805
  this.bindCalendarEvents();
806
806
  this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
807
- if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.renderDayCell)) {
807
+ if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
808
808
  this.disabledDateRender();
809
809
  }
810
810
  this.updateHeader();
@@ -975,8 +975,10 @@ var DateRangePicker = /** @class */ (function (_super) {
975
975
  if (range.length > 1) {
976
976
  this.invalidValueString = null;
977
977
  var dateOptions = { format: this.formatString, type: 'date', skeleton: 'yMd' };
978
- var startDate = this.globalize.parseDate(range[0].trim(), dateOptions);
979
- var endDate = this.globalize.parseDate(range[1].trim(), dateOptions);
978
+ var start = new Date(range[0]);
979
+ var end = new Date(range[1]);
980
+ var startDate = this.getStartEndDate(start, false, range, dateOptions);
981
+ var endDate = this.getStartEndDate(end, true, range, dateOptions);
980
982
  if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
981
983
  var prevStartVal = this.startValue;
982
984
  this.startValue = startDate;
@@ -1048,6 +1050,17 @@ var DateRangePicker = /** @class */ (function (_super) {
1048
1050
  }
1049
1051
  this.updateHiddenInput();
1050
1052
  };
1053
+ DateRangePicker.prototype.getStartEndDate = function (date, isEnd, range, dateOptions) {
1054
+ if (this.depth === 'Month') {
1055
+ return this.globalize.parseDate(range[isEnd ? 1 : 0].trim(), dateOptions);
1056
+ }
1057
+ else if (this.depth === 'Year') {
1058
+ return new Date(date.getFullYear(), date.getMonth() + (isEnd ? 1 : 0), isEnd ? 0 : 1);
1059
+ }
1060
+ else {
1061
+ return new Date(date.getFullYear(), isEnd ? 11 : 0, isEnd ? 31 : 1);
1062
+ }
1063
+ };
1051
1064
  DateRangePicker.prototype.clearRange = function () {
1052
1065
  this.previousStartValue = this.previousEndValue = null;
1053
1066
  this.currentDate = null;
@@ -1808,7 +1821,7 @@ var DateRangePicker = /** @class */ (function (_super) {
1808
1821
  if (!this.isMobile) {
1809
1822
  this.removeClassDisabled();
1810
1823
  }
1811
- if (!isNullOrUndefined(this.renderDayCell)) {
1824
+ if (!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
1812
1825
  this.disabledDateRender();
1813
1826
  }
1814
1827
  this.trigger('select', this.rangeArgs(event));
@@ -3386,7 +3399,7 @@ var DateRangePicker = /** @class */ (function (_super) {
3386
3399
  if (!this.strictMode && (isDisabled)) {
3387
3400
  this.clearRange();
3388
3401
  }
3389
- if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isDisabled && !isNullOrUndefined(this.renderDayCell)) {
3402
+ if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) && !isDisabled && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
3390
3403
  this.disabledDateRender();
3391
3404
  }
3392
3405
  this.errorClass();
@@ -3879,7 +3892,7 @@ var DateRangePicker = /** @class */ (function (_super) {
3879
3892
  if (!isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.endValue)) {
3880
3893
  range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
3881
3894
  this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
3882
- if (!isNullOrUndefined(this.renderDayCell)) {
3895
+ if (!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
3883
3896
  this.disabledDateRender();
3884
3897
  }
3885
3898
  if (!isNullOrUndefined(this.disabledDayCnt)) {
@@ -4133,6 +4146,17 @@ var DateRangePicker = /** @class */ (function (_super) {
4133
4146
  this.updateHeader();
4134
4147
  }
4135
4148
  };
4149
+ DateRangePicker.prototype.getStartEndValue = function (date, isEnd) {
4150
+ if (this.depth === 'Month') {
4151
+ return this.checkDateValue(new Date(this.checkValue(date)));
4152
+ }
4153
+ else if (this.depth === 'Year') {
4154
+ return new Date(date.getFullYear(), date.getMonth() + (isEnd ? 1 : 0), isEnd ? 0 : 1);
4155
+ }
4156
+ else {
4157
+ return new Date(date.getFullYear(), isEnd ? 11 : 0, isEnd ? 31 : 1);
4158
+ }
4159
+ };
4136
4160
  /**
4137
4161
  * Called internally if any of the property value changed.
4138
4162
  *
@@ -4222,7 +4246,7 @@ var DateRangePicker = /** @class */ (function (_super) {
4222
4246
  newProp.startDate = this.globalize.parseDate(newProp.startDate, format);
4223
4247
  }
4224
4248
  if (+this.initStartDate !== +newProp.startDate) {
4225
- this.startValue = this.checkDateValue(new Date(this.checkValue(newProp.startDate)));
4249
+ this.startValue = this.getStartEndValue(newProp.startDate, false);
4226
4250
  this.setDate();
4227
4251
  this.setValue();
4228
4252
  }
@@ -4232,7 +4256,7 @@ var DateRangePicker = /** @class */ (function (_super) {
4232
4256
  newProp.endDate = this.globalize.parseDate(newProp.endDate, format);
4233
4257
  }
4234
4258
  if (+this.initEndDate !== +newProp.endDate) {
4235
- this.endValue = this.checkDateValue(new Date(this.checkValue(newProp.endDate)));
4259
+ this.endValue = this.getStartEndValue(newProp.endDate, true);
4236
4260
  this.setDate();
4237
4261
  this.setValue();
4238
4262
  }
@@ -215,7 +215,7 @@ var DateTimePicker = /** @class */ (function (_super) {
215
215
  module: "MaskedDateTime",
216
216
  });
217
217
  }
218
- this.setValue();
218
+ this.setValue(true);
219
219
  if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
220
220
  Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
221
221
  }
@@ -234,7 +234,8 @@ var DateTimePicker = /** @class */ (function (_super) {
234
234
  }
235
235
  this.renderComplete();
236
236
  };
237
- DateTimePicker.prototype.setValue = function () {
237
+ DateTimePicker.prototype.setValue = function (isDynamic) {
238
+ if (isDynamic === void 0) { isDynamic = false; }
238
239
  this.initValue = this.validateMinMaxRange(this.value);
239
240
  if (!this.strictMode && this.isDateObject(this.initValue)) {
240
241
  var value = this.validateMinMaxRange(this.initValue);
@@ -248,7 +249,7 @@ var DateTimePicker = /** @class */ (function (_super) {
248
249
  }
249
250
  }
250
251
  this.valueWithMinutes = this.value;
251
- _super.prototype.updateInput.call(this);
252
+ _super.prototype.updateInput.call(this, isDynamic);
252
253
  };
253
254
  DateTimePicker.prototype.validateMinMaxRange = function (value) {
254
255
  var result = value;