@syncfusion/ej2-schedule 20.3.61 → 20.4.40

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.
Files changed (157) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +62 -46
  4. package/dist/ej2-schedule.min.js +2 -2
  5. package/dist/ej2-schedule.umd.min.js +2 -2
  6. package/dist/ej2-schedule.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es2015.js +786 -524
  8. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  9. package/dist/es6/ej2-schedule.es5.js +821 -535
  10. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  11. package/dist/global/ej2-schedule.min.js +2 -2
  12. package/dist/global/ej2-schedule.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +23 -33
  15. package/src/common/calendar-util.js +1 -1
  16. package/src/recurrence-editor/date-generator.js +26 -26
  17. package/src/recurrence-editor/recurrence-editor.js +5 -5
  18. package/src/schedule/actions/action-base.js +3 -3
  19. package/src/schedule/actions/crud.js +16 -16
  20. package/src/schedule/actions/drag.js +36 -32
  21. package/src/schedule/actions/keyboard.js +10 -8
  22. package/src/schedule/actions/resize.js +6 -6
  23. package/src/schedule/actions/touch.js +4 -3
  24. package/src/schedule/actions/virtual-scroll.js +10 -7
  25. package/src/schedule/base/interface.d.ts +8 -1
  26. package/src/schedule/base/resource.d.ts +1 -0
  27. package/src/schedule/base/resource.js +179 -93
  28. package/src/schedule/base/schedule-model.d.ts +7 -0
  29. package/src/schedule/base/schedule.d.ts +23 -0
  30. package/src/schedule/base/schedule.js +73 -22
  31. package/src/schedule/base/util.js +4 -6
  32. package/src/schedule/event-renderer/agenda-base.js +36 -31
  33. package/src/schedule/event-renderer/event-base.js +25 -25
  34. package/src/schedule/event-renderer/inline-edit.js +8 -5
  35. package/src/schedule/event-renderer/month.js +17 -14
  36. package/src/schedule/event-renderer/timeline-view.js +11 -11
  37. package/src/schedule/event-renderer/vertical-view.d.ts +1 -0
  38. package/src/schedule/event-renderer/vertical-view.js +97 -70
  39. package/src/schedule/event-renderer/year.js +25 -17
  40. package/src/schedule/exports/calendar-export.js +4 -4
  41. package/src/schedule/exports/calendar-import.js +14 -15
  42. package/src/schedule/exports/excel-export.js +1 -1
  43. package/src/schedule/models/group-model.d.ts +8 -0
  44. package/src/schedule/models/group.d.ts +7 -0
  45. package/src/schedule/models/group.js +3 -0
  46. package/src/schedule/models/views-model.d.ts +8 -1
  47. package/src/schedule/models/views.d.ts +7 -1
  48. package/src/schedule/models/views.js +3 -0
  49. package/src/schedule/popups/event-tooltip.js +3 -2
  50. package/src/schedule/popups/event-window.js +36 -30
  51. package/src/schedule/popups/quick-popups.js +6 -6
  52. package/src/schedule/renderer/agenda.js +5 -5
  53. package/src/schedule/renderer/header-renderer.d.ts +1 -1
  54. package/src/schedule/renderer/header-renderer.js +21 -5
  55. package/src/schedule/renderer/month-agenda.js +11 -4
  56. package/src/schedule/renderer/month.js +44 -16
  57. package/src/schedule/renderer/renderer.js +3 -3
  58. package/src/schedule/renderer/timeline-header-row.js +7 -7
  59. package/src/schedule/renderer/timeline-month.js +5 -5
  60. package/src/schedule/renderer/timeline-view.js +2 -2
  61. package/src/schedule/renderer/timeline-year.js +20 -14
  62. package/src/schedule/renderer/vertical-view.js +24 -9
  63. package/src/schedule/renderer/view-base.d.ts +3 -0
  64. package/src/schedule/renderer/view-base.js +11 -3
  65. package/src/schedule/renderer/year.js +11 -5
  66. package/styles/bootstrap-dark.css +364 -101
  67. package/styles/bootstrap.css +363 -99
  68. package/styles/bootstrap4.css +375 -141
  69. package/styles/bootstrap5-dark.css +339 -137
  70. package/styles/bootstrap5.css +339 -137
  71. package/styles/fabric-dark.css +330 -101
  72. package/styles/fabric.css +316 -106
  73. package/styles/fluent-dark.css +395 -102
  74. package/styles/fluent.css +395 -102
  75. package/styles/highcontrast-light.css +407 -98
  76. package/styles/highcontrast.css +399 -113
  77. package/styles/material-dark.css +362 -110
  78. package/styles/material.css +404 -110
  79. package/styles/recurrence-editor/_layout.scss +42 -28
  80. package/styles/recurrence-editor/bootstrap-dark.css +137 -28
  81. package/styles/recurrence-editor/bootstrap-dark.scss +5 -0
  82. package/styles/recurrence-editor/bootstrap.css +137 -28
  83. package/styles/recurrence-editor/bootstrap.scss +5 -0
  84. package/styles/recurrence-editor/bootstrap4.css +171 -28
  85. package/styles/recurrence-editor/bootstrap4.scss +5 -0
  86. package/styles/recurrence-editor/bootstrap5-dark.css +178 -28
  87. package/styles/recurrence-editor/bootstrap5-dark.scss +5 -0
  88. package/styles/recurrence-editor/bootstrap5.css +178 -28
  89. package/styles/recurrence-editor/bootstrap5.scss +5 -0
  90. package/styles/recurrence-editor/fabric-dark.css +113 -28
  91. package/styles/recurrence-editor/fabric-dark.scss +5 -0
  92. package/styles/recurrence-editor/fabric.css +106 -28
  93. package/styles/recurrence-editor/fabric.scss +5 -0
  94. package/styles/recurrence-editor/fluent-dark.css +158 -28
  95. package/styles/recurrence-editor/fluent-dark.scss +5 -0
  96. package/styles/recurrence-editor/fluent.css +158 -28
  97. package/styles/recurrence-editor/fluent.scss +5 -0
  98. package/styles/recurrence-editor/highcontrast-light.css +110 -28
  99. package/styles/recurrence-editor/highcontrast-light.scss +5 -0
  100. package/styles/recurrence-editor/highcontrast.css +110 -28
  101. package/styles/recurrence-editor/highcontrast.scss +5 -0
  102. package/styles/recurrence-editor/material-dark.css +138 -28
  103. package/styles/recurrence-editor/material-dark.scss +5 -0
  104. package/styles/recurrence-editor/material.css +163 -28
  105. package/styles/recurrence-editor/material.scss +5 -0
  106. package/styles/recurrence-editor/tailwind-dark.css +126 -28
  107. package/styles/recurrence-editor/tailwind-dark.scss +5 -0
  108. package/styles/recurrence-editor/tailwind.css +126 -28
  109. package/styles/recurrence-editor/tailwind.scss +5 -0
  110. package/styles/schedule/_bootstrap-dark-definition.scss +63 -4
  111. package/styles/schedule/_bootstrap-definition.scss +62 -3
  112. package/styles/schedule/_bootstrap4-definition.scss +65 -5
  113. package/styles/schedule/_bootstrap5-definition.scss +63 -5
  114. package/styles/schedule/_fabric-dark-definition.scss +61 -3
  115. package/styles/schedule/_fabric-definition.scss +62 -3
  116. package/styles/schedule/_fluent-definition.scss +63 -6
  117. package/styles/schedule/_fusionnew-definition.scss +60 -3
  118. package/styles/schedule/_highcontrast-definition.scss +62 -3
  119. package/styles/schedule/_highcontrast-light-definition.scss +62 -3
  120. package/styles/schedule/_layout.scss +117 -506
  121. package/styles/schedule/_material-dark-definition.scss +63 -4
  122. package/styles/schedule/_material-definition.scss +63 -4
  123. package/styles/schedule/_material3-definition.scss +62 -3
  124. package/styles/schedule/_tailwind-definition.scss +63 -6
  125. package/styles/schedule/_theme.scss +97 -62
  126. package/styles/schedule/bootstrap-dark.css +332 -73
  127. package/styles/schedule/bootstrap-dark.scss +11 -0
  128. package/styles/schedule/bootstrap.css +331 -71
  129. package/styles/schedule/bootstrap.scss +11 -0
  130. package/styles/schedule/bootstrap4.css +343 -113
  131. package/styles/schedule/bootstrap4.scss +11 -0
  132. package/styles/schedule/bootstrap5-dark.css +307 -109
  133. package/styles/schedule/bootstrap5-dark.scss +11 -0
  134. package/styles/schedule/bootstrap5.css +307 -109
  135. package/styles/schedule/bootstrap5.scss +11 -0
  136. package/styles/schedule/fabric-dark.css +298 -73
  137. package/styles/schedule/fabric-dark.scss +11 -0
  138. package/styles/schedule/fabric.css +284 -78
  139. package/styles/schedule/fabric.scss +11 -0
  140. package/styles/schedule/fluent-dark.css +363 -74
  141. package/styles/schedule/fluent-dark.scss +11 -0
  142. package/styles/schedule/fluent.css +363 -74
  143. package/styles/schedule/fluent.scss +11 -0
  144. package/styles/schedule/highcontrast-light.css +375 -70
  145. package/styles/schedule/highcontrast-light.scss +11 -0
  146. package/styles/schedule/highcontrast.css +367 -85
  147. package/styles/schedule/highcontrast.scss +11 -0
  148. package/styles/schedule/material-dark.css +330 -82
  149. package/styles/schedule/material-dark.scss +11 -0
  150. package/styles/schedule/material.css +372 -82
  151. package/styles/schedule/material.scss +11 -0
  152. package/styles/schedule/tailwind-dark.css +246 -111
  153. package/styles/schedule/tailwind-dark.scss +11 -0
  154. package/styles/schedule/tailwind.css +246 -111
  155. package/styles/schedule/tailwind.scss +11 -0
  156. package/styles/tailwind-dark.css +279 -140
  157. package/styles/tailwind.css +279 -140
@@ -356,8 +356,6 @@ function getDateFromString(date) {
356
356
  return date.indexOf('Date') !== -1 ? new Date(parseInt(date.match(/\d+/g).toString(), 10)) :
357
357
  date.indexOf('T') !== -1 ? new Date(date) : new Date(date.replace(/-/g, '/'));
358
358
  }
359
- /** @private */
360
- let scrollWidth = null;
361
359
  /**
362
360
  * Method to get scrollbar width
363
361
  *
@@ -373,7 +371,7 @@ function getScrollBarWidth() {
373
371
  Math.ceil(devicePixelRatio % 1) : Math.floor(devicePixelRatio % 1) : 0;
374
372
  value = (divNode.offsetWidth - divNode.clientWidth - ratio) | 0;
375
373
  document.body.removeChild(divNode);
376
- return scrollWidth = value;
374
+ return value;
377
375
  }
378
376
  /**
379
377
  * Method to find the index from data collection
@@ -388,12 +386,12 @@ function getScrollBarWidth() {
388
386
  // eslint-disable-next-line max-len
389
387
  function findIndexInData(data, field, value, event, resourceCollection) {
390
388
  for (let i = 0, length = data.length; i < length; i++) {
391
- if (data[i][field] === value) {
389
+ if (data[parseInt(i.toString(), 10)][`${field}`] === value) {
392
390
  if (event) {
393
391
  const field = resourceCollection.slice(-2)[0].field;
394
- const res = (event[field] instanceof Array ? event[field] : [event[field]]);
392
+ const res = (event[`${field}`] instanceof Array ? event[`${field}`] : [event[`${field}`]]);
395
393
  const resData = res.join(',');
396
- if (resData.includes(data[i][resourceCollection.slice(-1)[0].groupIDField])) {
394
+ if (resData.includes(data[parseInt(i.toString(), 10)][resourceCollection.slice(-1)[0].groupIDField])) {
397
395
  return i;
398
396
  }
399
397
  }
@@ -1098,13 +1096,29 @@ class HeaderRenderer {
1098
1096
  addClass([selEle[this.parent.viewIndex]], ['e-active-view']);
1099
1097
  }
1100
1098
  }
1101
- updateDateRange(text) {
1099
+ updateDateRange(date) {
1102
1100
  const selEle = this.toolbarObj.element.querySelector('.e-date-range');
1103
- if (selEle) {
1101
+ if (!selEle) {
1102
+ return;
1103
+ }
1104
+ const textEle = selEle.querySelector('.e-tbar-btn-text');
1105
+ if (this.parent.activeViewOptions.dateRangeTemplate) {
1106
+ textEle.textContent = '';
1107
+ const args = {
1108
+ startDate: this.parent.activeView.getStartDate(),
1109
+ endDate: this.parent.activeView.getEndDate(), currentView: this.parent.currentView
1110
+ };
1111
+ const viewName = this.parent.activeViewOptions.dateRangeTemplateName;
1112
+ const templateId = this.parent.element.id + '_' + viewName + 'dateRangeTemplate';
1113
+ const dateTemplate = [].slice.call(this.parent.getDateRangeTemplate()(args, this.parent, 'dateRangeTemplate', templateId, false));
1114
+ append(dateTemplate, textEle);
1115
+ }
1116
+ else {
1117
+ const text = this.parent.activeView.getDateRangeText(date);
1104
1118
  selEle.setAttribute('aria-label', text);
1105
- selEle.querySelector('.e-tbar-btn-text').innerHTML = text;
1106
- this.refresh();
1119
+ textEle.textContent = text;
1107
1120
  }
1121
+ this.refresh();
1108
1122
  }
1109
1123
  refresh() {
1110
1124
  if (this.toolbarObj) {
@@ -1604,8 +1618,9 @@ class ScheduleTouch {
1604
1618
  }
1605
1619
  scrollHandler(e) {
1606
1620
  if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action || !this.parent.allowSwiping ||
1607
- (e.originalEvent && e.originalEvent.target && (e.originalEvent.target.classList.contains(APPOINTMENT_CLASS) ||
1608
- closest(e.originalEvent.target, '.' + APPOINTMENT_CLASS)) && !this.parent.isAdaptive)) {
1621
+ (e.originalEvent && e.originalEvent.target &&
1622
+ (e.originalEvent.target.classList.contains(APPOINTMENT_CLASS) ||
1623
+ closest(e.originalEvent.target, '.' + APPOINTMENT_CLASS)) && !this.parent.isAdaptive)) {
1609
1624
  return;
1610
1625
  }
1611
1626
  if (!this.timeStampStart) {
@@ -1756,7 +1771,7 @@ class ScheduleTouch {
1756
1771
  addClass([this.element], TRANSLATE_CLASS);
1757
1772
  this.element.style.transform = 'translatex(' + translateX + 'px)';
1758
1773
  if (this.parent.headerModule) {
1759
- this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());
1774
+ this.parent.headerModule.updateDateRange();
1760
1775
  }
1761
1776
  this.parent.renderTemplates();
1762
1777
  this.parent.crudModule.refreshDataManager();
@@ -2329,7 +2344,7 @@ class KeyboardInteraction {
2329
2344
  const appointmentElements = [];
2330
2345
  appointments.map((value) => value.getAttribute('data-guid')).filter((value, index, self) => {
2331
2346
  if (self.indexOf(value) === index) {
2332
- appointmentElements.push(appointments[index]);
2347
+ appointmentElements.push(appointments[parseInt(index.toString(), 10)]);
2333
2348
  }
2334
2349
  });
2335
2350
  return appointmentElements;
@@ -2341,7 +2356,7 @@ class KeyboardInteraction {
2341
2356
  processViewNavigation(e) {
2342
2357
  const index = parseInt(e.key, 10) - 1;
2343
2358
  if (index < this.parent.views.length) {
2344
- const view = this.parent.viewCollections[index].option;
2359
+ const view = this.parent.viewCollections[parseInt(index.toString(), 10)].option;
2345
2360
  this.parent.changeView(view, e, undefined, index);
2346
2361
  if (this.parent.headerModule) {
2347
2362
  this.parent.headerModule.element.querySelector('.e-active-view button').focus();
@@ -2454,10 +2469,11 @@ class KeyboardInteraction {
2454
2469
  }
2455
2470
  }
2456
2471
  getYearUpDownCell(tableRows, rowIndex, cellIndex, isUp) {
2457
- while (tableRows[rowIndex] && tableRows[rowIndex].cells[cellIndex].classList.contains(OTHERMONTH_CLASS)) {
2472
+ while (tableRows[parseInt(rowIndex.toString(), 10)] &&
2473
+ tableRows[parseInt(rowIndex.toString(), 10)].cells[parseInt(cellIndex.toString(), 10)].classList.contains(OTHERMONTH_CLASS)) {
2458
2474
  rowIndex = rowIndex + (isUp ? -1 : 1);
2459
2475
  }
2460
- return tableRows[rowIndex].cells[cellIndex];
2476
+ return tableRows[parseInt(rowIndex.toString(), 10)].cells[parseInt(cellIndex.toString(), 10)];
2461
2477
  }
2462
2478
  // eslint-disable-next-line max-len
2463
2479
  getHorizontalUpDownCell(tableRows, target, curRowIndex, isUp) {
@@ -2476,7 +2492,7 @@ class KeyboardInteraction {
2476
2492
  const hasRow = isUp && curRowIndex > 0 || !isUp && curRowIndex < tableRows.length - 1;
2477
2493
  let targetCell = hasRow ? tableRows[curRowIndex + (isUp ? -1 : 1)].cells[target.cellIndex] : undefined;
2478
2494
  if (!targetCell || targetCell.classList.contains(OTHERMONTH_CLASS)) {
2479
- const column = tableRows[curRowIndex].cells[target.cellIndex - (isUp ? 1 : -1)];
2495
+ const column = tableRows[parseInt(curRowIndex.toString(), 10)].cells[target.cellIndex - (isUp ? 1 : -1)];
2480
2496
  if (column) {
2481
2497
  const dateAttr = +target.getAttribute('data-date') - (isUp ? MS_PER_DAY : -MS_PER_DAY);
2482
2498
  return this.parent.getContentTable().querySelector('.' + WORK_CELLS_CLASS + '[data-date="' + dateAttr + '"]');
@@ -2492,7 +2508,7 @@ class KeyboardInteraction {
2492
2508
  element: tableEle,
2493
2509
  rowIndex: curRowIndex,
2494
2510
  columnIndex: target.cellIndex,
2495
- maxIndex: tableEle.rows[curRowIndex].cells.length
2511
+ maxIndex: tableEle.rows[parseInt(curRowIndex.toString(), 10)].cells.length
2496
2512
  };
2497
2513
  return key;
2498
2514
  }
@@ -2565,7 +2581,8 @@ class KeyboardInteraction {
2565
2581
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
2566
2582
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2567
2583
  const tableEle = this.parent.getContentTable();
2568
- const cell = isMonthEnd ? tableEle.rows[rowIndex].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')') : tableEle.rows[rowIndex].cells[0];
2584
+ const cell = isMonthEnd ? tableEle.rows[parseInt(rowIndex.toString(), 10)].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')')
2585
+ : tableEle.rows[parseInt(rowIndex.toString(), 10)].cells[0];
2569
2586
  this.selectCells(false, cell);
2570
2587
  }
2571
2588
  }
@@ -2635,7 +2652,7 @@ class KeyboardInteraction {
2635
2652
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
2636
2653
  const tableEle = this.parent.getContentTable();
2637
2654
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
2638
- let cell = tableEle.rows[rowIndex].cells[key.maxIndex - 1];
2655
+ let cell = tableEle.rows[parseInt(rowIndex.toString(), 10)].cells[key.maxIndex - 1];
2639
2656
  if (isMonthStart) {
2640
2657
  const tbody = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody');
2641
2658
  cell = tbody.item(tbody.length - 1).querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + this.parent.activeView.getEndDate().getTime() + '"]');
@@ -3158,7 +3175,7 @@ class Islamic {
3158
3175
  const hDate = this.getHijriDate(date);
3159
3176
  const day = [];
3160
3177
  for (let i = 0; i < days.length; i++) {
3161
- const gDate = HijriParser.toGregorian(hDate.year, hDate.month, days[i]);
3178
+ const gDate = HijriParser.toGregorian(hDate.year, hDate.month, days[parseInt(i.toString(), 10)]);
3162
3179
  day.push(gDate.getDate());
3163
3180
  }
3164
3181
  return day;
@@ -3572,7 +3589,7 @@ function generateSummary(rule, localeObject, locale, calendarType = 'Gregorian')
3572
3589
  case 'WEEKLY':
3573
3590
  summary += localeObject.getConstant(WEEKS) + ' ' + localeObject.getConstant(ON) + ' ';
3574
3591
  ruleObject.day.forEach((day, index) => {
3575
- summary += capitalizeFirstWord(getValue(DAYINDEXOBJECT[day], cldrObj), 'single');
3592
+ summary += capitalizeFirstWord(getValue(DAYINDEXOBJECT[`${day}`], cldrObj), 'single');
3576
3593
  summary += (((ruleObject.day.length - 1) === index) ? '' : ', ');
3577
3594
  });
3578
3595
  break;
@@ -3665,7 +3682,7 @@ function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount = M
3665
3682
  return data;
3666
3683
  }
3667
3684
  maxOccurrence = maximumCount;
3668
- setFirstDayOfWeek(DAYINDEX[startDayOfWeek]);
3685
+ setFirstDayOfWeek(DAYINDEX[parseInt(startDayOfWeek.toString(), 10)]);
3669
3686
  if (ruleObject.until) {
3670
3687
  const end = resetTime(ruleObject.until);
3671
3688
  ruleObject.until = new Date(end.getFullYear(), end.getMonth(), end.getDate(), 23, 59, 59);
@@ -3941,7 +3958,7 @@ function processWeekNo(startDate, endDate, data, ruleObject) {
3941
3958
  startDay = dayIndex.indexOf(DAYINDEX[stDate.getDay()]);
3942
3959
  firstWeekSpan = (6 - startDay) + 1;
3943
3960
  for (let index = 0; index < weekNos.length; index++) {
3944
- weekNo = weekNos[index];
3961
+ weekNo = weekNos[parseInt(index.toString(), 10)];
3945
3962
  weekNo = (weekNo > 0) ? weekNo : 53 + weekNo + 1;
3946
3963
  maxDate = (weekNo === 1) ? firstWeekSpan : firstWeekSpan + ((weekNo - 1) * 7);
3947
3964
  minDate = (weekNo === 1) ? firstWeekSpan - 7 : firstWeekSpan + ((weekNo - 2) * 7);
@@ -3988,7 +4005,7 @@ function processYearDay(startDate, endDate, data, ruleObject) {
3988
4005
  const expectedDays = ruleObject.day;
3989
4006
  while (compareDates(stDate, endDate)) {
3990
4007
  for (let index = 0; index < ruleObject.yearDay.length; index++) {
3991
- date = ruleObject.yearDay[index];
4008
+ date = ruleObject.yearDay[parseInt(index.toString(), 10)];
3992
4009
  tempDate = new Date(stDate.getTime());
3993
4010
  if ((date === calendarUtil.getLeapYearDaysCount() || date === -calendarUtil.getLeapYearDaysCount()) &&
3994
4011
  (!calendarUtil.isLeapYear(calendarUtil.getFullYear(tempDate), 1))) {
@@ -4148,7 +4165,7 @@ function monthlyDateTypeProcessforMonthFreq(startDate, endDate, data, ruleObject
4148
4165
  */
4149
4166
  function processDateCollectionForByMonthDay(ruleObject, recRuleVariables, endDate, isByMonth, startDate, data) {
4150
4167
  for (let index = 0; index < ruleObject.monthDay.length; index++) {
4151
- recRuleVariables.date = ruleObject.monthDay[index];
4168
+ recRuleVariables.date = ruleObject.monthDay[parseInt(index.toString(), 10)];
4152
4169
  recRuleVariables.tempDate = calendarUtil.getMonthStartDate(recRuleVariables.tempDate);
4153
4170
  const maxDate = calendarUtil.getMonthDaysCount(recRuleVariables.tempDate);
4154
4171
  recRuleVariables.date = recRuleVariables.date > 0 ? recRuleVariables.date : (maxDate + recRuleVariables.date + 1);
@@ -4191,7 +4208,7 @@ function setNextValidDate(tempDate, ruleObject, monthInit, beginDate = null, int
4191
4208
  if (ruleObject.month.length) {
4192
4209
  monthInit++;
4193
4210
  monthInit = monthInit % ruleObject.month.length;
4194
- calendarUtil.setMonth(tempDate, ruleObject.month[monthInit], 1);
4211
+ calendarUtil.setMonth(tempDate, ruleObject.month[parseInt(monthInit.toString(), 10)], 1);
4195
4212
  if (monthInit === 0) {
4196
4213
  calendarUtil.addYears(tempDate, interval, ruleObject.month[0]);
4197
4214
  }
@@ -4236,7 +4253,7 @@ function getMonthCollection(startDate, endDate, data, ruleObject) {
4236
4253
  const isHavingNumber = expectedDays.map((item) => HASNUMBER.test(item));
4237
4254
  if (isHavingNumber.indexOf(true) > -1) {
4238
4255
  for (let j = 0; j <= expectedDays.length - 1; j++) {
4239
- const expectedDaysArray = expectedDays[j].match(SPLITNUMBERANDSTRING);
4256
+ const expectedDaysArray = expectedDays[parseInt(j.toString(), 10)].match(SPLITNUMBERANDSTRING);
4240
4257
  const position = parseInt(expectedDaysArray[0], 10);
4241
4258
  tempDate = new Date(tempDate.getTime());
4242
4259
  tempDate = calendarUtil.getMonthStartDate(tempDate);
@@ -4297,8 +4314,8 @@ function getMonthCollection(startDate, endDate, data, ruleObject) {
4297
4314
  index = 0;
4298
4315
  const datas = [];
4299
4316
  for (let week = 0; week < monthCollection.length; week++) {
4300
- for (let row = 0; row < monthCollection[week].length; row++) {
4301
- datas.push(monthCollection[week][row]);
4317
+ for (let row = 0; row < monthCollection[parseInt(week.toString(), 10)].length; row++) {
4318
+ datas.push(monthCollection[parseInt(week.toString(), 10)][parseInt(row.toString(), 10)]);
4302
4319
  }
4303
4320
  }
4304
4321
  monthCollection = [datas];
@@ -4490,8 +4507,8 @@ function processDateCollectionforByDayWithInteger(startDate, endDate, data, rule
4490
4507
  while (calendarUtil.isSameYear(currentMonthDate, tempDate)) {
4491
4508
  currentMonthDate = new Date(tempDate.getTime());
4492
4509
  if (ruleObject.month.length === 0 ||
4493
- (ruleObject.month.length > 0 && ruleObject.month[i] === calendarUtil.getMonth(currentMonthDate))) {
4494
- const expectedDaysArray = expectedDays[j].match(SPLITNUMBERANDSTRING);
4510
+ (ruleObject.month.length > 0 && ruleObject.month[parseInt(i.toString(), 10)] === calendarUtil.getMonth(currentMonthDate))) {
4511
+ const expectedDaysArray = expectedDays[parseInt(j.toString(), 10)].match(SPLITNUMBERANDSTRING);
4495
4512
  const position = parseInt(expectedDaysArray[0], 10);
4496
4513
  currentDate = new Date(tempDate.getTime());
4497
4514
  while (calendarUtil.isSameYear(currentDate, tempDate)
@@ -4610,8 +4627,8 @@ function insertDataCollection(dateCollection, state, startDate, endDate, data, r
4610
4627
  function getDateCollectionforBySetPosNull(monthCollection) {
4611
4628
  const datas = [];
4612
4629
  for (let week = 0; week < monthCollection.length; week++) {
4613
- for (let row = 0; row < monthCollection[week].length; row++) {
4614
- datas.push(new Date(monthCollection[week][row]).getTime());
4630
+ for (let row = 0; row < monthCollection[parseInt(week.toString(), 10)].length; row++) {
4631
+ datas.push(new Date(monthCollection[parseInt(week.toString(), 10)][parseInt(row.toString(), 10)]).getTime());
4615
4632
  }
4616
4633
  }
4617
4634
  monthCollection = datas.length > 0 ? [datas] : [];
@@ -4657,8 +4674,8 @@ function insertDateCollectionBasedonIndex(monthCollection, startDate, endDate, d
4657
4674
  * @private
4658
4675
  */
4659
4676
  function filterDateCollectionByIndex(monthCollection, index, datas) {
4660
- for (let week = 0; week < monthCollection[index].length; week++) {
4661
- datas.push(monthCollection[index][week]);
4677
+ for (let week = 0; week < monthCollection[parseInt(index.toString(), 10)].length; week++) {
4678
+ datas.push(monthCollection[parseInt(index.toString(), 10)][parseInt(week.toString(), 10)]);
4662
4679
  }
4663
4680
  return datas;
4664
4681
  }
@@ -4702,7 +4719,7 @@ function weekCount(year, startDayOfWeek, monthCollection, week, ruleObject) {
4702
4719
  const firstWeekDay = (firstOfMonth.getDay() - firstDayOfWeek + 7) % 7;
4703
4720
  const used = firstWeekDay + numberOfDaysInMonth;
4704
4721
  const count = Math.ceil(used / 7) - 1;
4705
- const dayData = monthCollection[week][count];
4722
+ const dayData = monthCollection[parseInt(week.toString(), 10)][parseInt(count.toString(), 10)];
4706
4723
  const chDate = new Date(dayData);
4707
4724
  const state = validateRules(chDate, ruleObject);
4708
4725
  return (state) ? count : count - 1;
@@ -4722,15 +4739,15 @@ function weekCount(year, startDayOfWeek, monthCollection, week, ruleObject) {
4722
4739
  function insertDateCollectionBasedonBySetPos(monthCollection, state, startDate, endDate, data, ruleObject) {
4723
4740
  if (monthCollection.length > 0) {
4724
4741
  for (let week = 0; week < monthCollection.length; week++) {
4725
- monthCollection[week].sort();
4742
+ monthCollection[parseInt(week.toString(), 10)].sort();
4726
4743
  const expectedDays = ruleObject.day;
4727
4744
  const isHavingNumber = expectedDays.map((item) => HASNUMBER.test(item));
4728
4745
  const weekIndex = (ruleObject.freq === 'YEARLY' && (ruleObject.validRules.indexOf('BYMONTH') > -1) &&
4729
4746
  !(isHavingNumber.indexOf(true) > -1)) ?
4730
4747
  weekCount(new Date(monthCollection[0][0]).getFullYear(), 0, monthCollection, week, ruleObject)
4731
- : (monthCollection[week].length + ruleObject.setPosition);
4748
+ : (monthCollection[parseInt(week.toString(), 10)].length + ruleObject.setPosition);
4732
4749
  const index = ((ruleObject.setPosition < 1) ? weekIndex : ruleObject.setPosition - 1);
4733
- const dayData = monthCollection[week][index];
4750
+ const dayData = monthCollection[parseInt(week.toString(), 10)][parseInt(index.toString(), 10)];
4734
4751
  insertDateCollection(state, startDate, endDate, data, ruleObject, dayData);
4735
4752
  }
4736
4753
  }
@@ -4753,9 +4770,9 @@ function insertDatasIntoExistingCollection(monthCollection, state, startDate, en
4753
4770
  index = !isNullOrUndefined(index) ? index :
4754
4771
  ((ruleObject.setPosition < 1)
4755
4772
  ? (monthCollection.length + ruleObject.setPosition) : ruleObject.setPosition - 1);
4756
- monthCollection[index].sort();
4757
- for (let week = 0; week < monthCollection[index].length; week++) {
4758
- const dayData = monthCollection[index][week];
4773
+ monthCollection[parseInt(index.toString(), 10)].sort();
4774
+ for (let week = 0; week < monthCollection[parseInt(index.toString(), 10)].length; week++) {
4775
+ const dayData = monthCollection[parseInt(index.toString(), 10)][parseInt(week.toString(), 10)];
4759
4776
  insertDateCollection(state, startDate, endDate, data, ruleObject, dayData);
4760
4777
  }
4761
4778
  }
@@ -4802,7 +4819,7 @@ function checkDayIndex(day, expectedDays) {
4802
4819
  sortedExpectedDays.push(expectedDaysNumberSplit[0]);
4803
4820
  }
4804
4821
  });
4805
- return (sortedExpectedDays.indexOf(DAYINDEX[day]) === -1);
4822
+ return (sortedExpectedDays.indexOf(DAYINDEX[parseInt(day.toString(), 10)]) === -1);
4806
4823
  }
4807
4824
  /**
4808
4825
  * Internal method to get start date of week
@@ -4818,7 +4835,7 @@ function getStartDateForWeek(startDate, expectedDays) {
4818
4835
  if (expectedDays.length > 0) {
4819
4836
  const expectedDaysArr = [];
4820
4837
  for (let i = 0; i <= expectedDays.length - 1; i++) {
4821
- newstr = getDayString(expectedDays[i]);
4838
+ newstr = getDayString(expectedDays[parseInt(i.toString(), 10)]);
4822
4839
  expectedDaysArr.push(newstr);
4823
4840
  }
4824
4841
  if (expectedDaysArr.indexOf(DAYINDEX[tempDate.getDay()]) === -1) {
@@ -4932,10 +4949,10 @@ function processWeekDays(expectedDays) {
4932
4949
  while (temp % 7 !== dayIndex.indexOf(expectedDays[0])) {
4933
4950
  temp++;
4934
4951
  }
4935
- dayCycle[element] = temp - startIndex;
4952
+ dayCycle[`${element}`] = temp - startIndex;
4936
4953
  }
4937
4954
  else {
4938
- dayCycle[element] = dayIndex.indexOf(expectedDays[(index + 1)]) - dayIndex.indexOf(element);
4955
+ dayCycle[`${element}`] = dayIndex.indexOf(expectedDays[(index + 1)]) - dayIndex.indexOf(element);
4939
4956
  }
4940
4957
  });
4941
4958
  return dayCycle;
@@ -5193,8 +5210,8 @@ class EventBase {
5193
5210
  event = this.processTimezone(event);
5194
5211
  }
5195
5212
  for (let level = 0; level < resourceCollection.length; level++) {
5196
- if (event[resourceCollection[level].field] === null || event[resourceCollection[level].field] === 0) {
5197
- event[resourceCollection[level].field] = undefined;
5213
+ if (event[resourceCollection[parseInt(level.toString(), 10)].field] === null || event[resourceCollection[parseInt(level.toString(), 10)].field] === 0) {
5214
+ event[resourceCollection[parseInt(level.toString(), 10)].field] = undefined;
5198
5215
  }
5199
5216
  }
5200
5217
  if (!isNullOrUndefined(event[fields.recurrenceRule]) && event[fields.recurrenceRule] === '') {
@@ -5345,7 +5362,7 @@ class EventBase {
5345
5362
  let resourceData;
5346
5363
  if (this.parent.activeViewOptions.group.resources.length > 0) {
5347
5364
  const data = this.getGroupIndexFromEvent(eventObj);
5348
- resourceData = this.parent.resourceBase.lastResourceLevel[data];
5365
+ resourceData = this.parent.resourceBase.lastResourceLevel[parseInt(data.toString(), 10)];
5349
5366
  }
5350
5367
  const blockEvents = extend([], this.parent.blockProcessed, null, true);
5351
5368
  for (const eventObj of blockEvents) {
@@ -5393,15 +5410,15 @@ class EventBase {
5393
5410
  const predicate = {};
5394
5411
  const resourceCollection = this.parent.resourceBase.resourceCollection;
5395
5412
  for (let level = 0; level < resourceCollection.length; level++) {
5396
- predicate[resourceCollection[level].field] = resourceTdData.groupOrder[level];
5413
+ predicate[resourceCollection[parseInt(level.toString(), 10)].field] = resourceTdData.groupOrder[parseInt(level.toString(), 10)];
5397
5414
  }
5398
5415
  const keys = Object.keys(predicate);
5399
5416
  const filteredCollection = appointments.filter((eventObj) => keys.every((key) => {
5400
- if (eventObj[key] instanceof Array) {
5401
- return eventObj[key].indexOf(predicate[key]) > -1;
5417
+ if (eventObj[`${key}`] instanceof Array) {
5418
+ return eventObj[`${key}`].indexOf(predicate[`${key}`]) > -1;
5402
5419
  }
5403
5420
  else {
5404
- return eventObj[key] === predicate[key];
5421
+ return eventObj[`${key}`] === predicate[`${key}`];
5405
5422
  }
5406
5423
  }));
5407
5424
  return filteredCollection;
@@ -5506,7 +5523,7 @@ class EventBase {
5506
5523
  }
5507
5524
  let cStart = start;
5508
5525
  for (let level = 0; level < this.slots.length; level++) {
5509
- let slot = this.slots[level];
5526
+ let slot = this.slots[parseInt(level.toString(), 10)];
5510
5527
  if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek'
5511
5528
  || this.parent.activeViewOptions.group.byDate || this.parent.activeViewOptions.showWeekend) {
5512
5529
  const slotDates = [];
@@ -5539,9 +5556,9 @@ class EventBase {
5539
5556
  const hasBreak = endIndex !== -1;
5540
5557
  endIndex = hasBreak ? endIndex : slot.length - 1;
5541
5558
  const count = ((endIndex - startIndex) + 1);
5542
- const isLeft = (slot[startIndex] !== orgStart);
5543
- const isRight = (slot[endIndex] !== orgEnd);
5544
- ranges.push(this.cloneEventObject(event, slot[startIndex], slot[endIndex], count, isLeft, isRight));
5559
+ const isLeft = (slot[parseInt(startIndex.toString(), 10)] !== orgStart);
5560
+ const isRight = (slot[parseInt(endIndex.toString(), 10)] !== orgEnd);
5561
+ ranges.push(this.cloneEventObject(event, slot[parseInt(startIndex.toString(), 10)], slot[parseInt(endIndex.toString(), 10)], count, isLeft, isRight));
5545
5562
  if (hasBreak) {
5546
5563
  break;
5547
5564
  }
@@ -5551,8 +5568,8 @@ class EventBase {
5551
5568
  if (this.dateInRange(cStart, slot[0], slot[slot.length - 1])) {
5552
5569
  const availSlot = [];
5553
5570
  for (let i = 0; i < slot.length; i++) {
5554
- if (this.dateInRange(slot[i], orgStart, orgEnd)) {
5555
- availSlot.push(slot[i]);
5571
+ if (this.dateInRange(slot[parseInt(i.toString(), 10)], orgStart, orgEnd)) {
5572
+ availSlot.push(slot[parseInt(i.toString(), 10)]);
5556
5573
  }
5557
5574
  }
5558
5575
  if (availSlot.length > 0) {
@@ -5719,9 +5736,9 @@ class EventBase {
5719
5736
  let levelName;
5720
5737
  let idField;
5721
5738
  for (let i = this.parent.resourceBase.resourceCollection.length - 1; i >= 0; i--) {
5722
- const resourceData = eventData[this.parent.resourceBase.resourceCollection[i].field];
5739
+ const resourceData = eventData[this.parent.resourceBase.resourceCollection[parseInt(i.toString(), 10)].field];
5723
5740
  if (!isNullOrUndefined(resourceData)) {
5724
- resource = this.parent.resourceBase.resourceCollection[i];
5741
+ resource = this.parent.resourceBase.resourceCollection[parseInt(i.toString(), 10)];
5725
5742
  levelIndex = i;
5726
5743
  levelName = resource.name;
5727
5744
  idField = resource.field;
@@ -5740,8 +5757,8 @@ class EventBase {
5740
5757
  return null;
5741
5758
  })[0];
5742
5759
  }
5743
- const id = ((eventData[idField] instanceof Array) ?
5744
- eventData[idField][0] : eventData[idField]);
5760
+ const id = ((eventData[`${idField}`] instanceof Array) ?
5761
+ eventData[`${idField}`][0] : eventData[`${idField}`]);
5745
5762
  if (levelIndex > 0) {
5746
5763
  const parentField = this.parent.resourceCollection[levelIndex - 1].field;
5747
5764
  return this.parent.resourceBase.getIndexFromResourceId(id, levelName, resource, eventData, parentField);
@@ -6097,7 +6114,7 @@ class EventBase {
6097
6114
  const idField = isGuid ? 'Guid' : (isFollowing) ? this.parent.eventFields.followingID : this.parent.eventFields.recurrenceID;
6098
6115
  const fieldKey = isGuid ? 'Guid' : this.parent.eventFields.id;
6099
6116
  const dataSource = isGuid ? this.parent.eventsProcessed : this.parent.eventsData;
6100
- return dataSource.filter((data) => data[idField] === eventObj[fieldKey]);
6117
+ return dataSource.filter((data) => data[`${idField}`] === eventObj[`${fieldKey}`]);
6101
6118
  }
6102
6119
  getOccurrencesByID(id) {
6103
6120
  const fields = this.parent.eventFields;
@@ -6134,13 +6151,13 @@ class EventBase {
6134
6151
  if (parentObject[fields.recurrenceException]) {
6135
6152
  const exDateString = parentObject[fields.recurrenceException].split(',');
6136
6153
  for (let i = 0, len = exDateString.length; i < len; i++) {
6137
- const edited = this.parent.eventsData.filter((eventObj) => eventObj[fields.recurrenceID] === parentObject[fields.id] && eventObj[fields.recurrenceException] === exDateString[i]);
6154
+ const edited = this.parent.eventsData.filter((eventObj) => eventObj[fields.recurrenceID] === parentObject[fields.id] && eventObj[fields.recurrenceException] === exDateString[parseInt(i.toString(), 10)]);
6138
6155
  if (edited.length === 0) {
6139
- const exDate = getDateFromRecurrenceDateString(exDateString[i]);
6156
+ const exDate = getDateFromRecurrenceDateString(exDateString[parseInt(i.toString(), 10)]);
6140
6157
  const childObject = extend({}, recurrenceData, null, true);
6141
6158
  childObject[fields.recurrenceID] = parentObject[fields.id];
6142
6159
  delete childObject[fields.followingID];
6143
- childObject[fields.recurrenceException] = exDateString[i];
6160
+ childObject[fields.recurrenceException] = exDateString[parseInt(i.toString(), 10)];
6144
6161
  const startDate = new Date(exDate.getTime());
6145
6162
  const time = parentObject[fields.endTime].getTime() - parentObject[fields.startTime].getTime();
6146
6163
  const endDate = new Date(startDate.getTime());
@@ -6285,14 +6302,14 @@ class EventBase {
6285
6302
  let filteredDates;
6286
6303
  if (dateRender[0] < this.parent.minDate && dateRender[dateRender.length - 1] > this.parent.maxDate) {
6287
6304
  for (let i = 0; i < dateRender.length; i++) {
6288
- if (resetTime(dateRender[i]).getTime() === resetTime(new Date(this.parent.minDate)).getTime()) {
6305
+ if (resetTime(dateRender[parseInt(i.toString(), 10)]).getTime() === resetTime(new Date(this.parent.minDate)).getTime()) {
6289
6306
  firstDate = i;
6290
6307
  }
6291
- if (resetTime(dateRender[i]).getTime() === resetTime(new Date(this.parent.maxDate)).getTime()) {
6308
+ if (resetTime(dateRender[parseInt(i.toString(), 10)]).getTime() === resetTime(new Date(this.parent.maxDate)).getTime()) {
6292
6309
  lastDate = i;
6293
6310
  }
6294
6311
  }
6295
- filteredDates = dateRender.filter((date) => date >= dateRender[firstDate] && date <= dateRender[lastDate]);
6312
+ filteredDates = dateRender.filter((date) => date >= dateRender[parseInt(firstDate.toString(), 10)] && date <= dateRender[parseInt(lastDate.toString(), 10)]);
6296
6313
  }
6297
6314
  return filteredDates;
6298
6315
  }
@@ -6341,7 +6358,7 @@ class EventBase {
6341
6358
  const tr = createElement('tr');
6342
6359
  const levels = this.parent.activeView.colLevels.slice(-1)[0];
6343
6360
  for (let i = 0, len = levels.length; i < len; i++) {
6344
- const col = levels[i];
6361
+ const col = levels[parseInt(i.toString(), 10)];
6345
6362
  const appointmentWrap = createElement('td', {
6346
6363
  className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
6347
6364
  TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
@@ -6413,8 +6430,8 @@ class VerticalEvent extends EventBase {
6413
6430
  wrapper.classList.contains(ROW_COUNT_WRAPPER_CLASS))) {
6414
6431
  const groupIndex = parseInt(wrapper.getAttribute('data-group-index'), 10);
6415
6432
  for (let j = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; j < len; j++) {
6416
- if (groupIndex === this.parent.crudModule.crudObj.sourceEvent[j].groupIndex ||
6417
- groupIndex === this.parent.crudModule.crudObj.targetEvent[j].groupIndex) {
6433
+ if (groupIndex === this.parent.crudModule.crudObj.sourceEvent[parseInt(j.toString(), 10)].groupIndex ||
6434
+ groupIndex === this.parent.crudModule.crudObj.targetEvent[parseInt(j.toString(), 10)].groupIndex) {
6418
6435
  remove(wrapper);
6419
6436
  }
6420
6437
  }
@@ -6467,7 +6484,7 @@ class VerticalEvent extends EventBase {
6467
6484
  this.dateRender[0] = this.parent.activeView.renderDates;
6468
6485
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6469
6486
  for (let i = 0, len = this.resources.length; i < len; i++) {
6470
- this.dateRender[i] = this.resources[i].renderDates;
6487
+ this.dateRender[parseInt(i.toString(), 10)] = this.resources[parseInt(i.toString(), 10)].renderDates;
6471
6488
  }
6472
6489
  }
6473
6490
  }
@@ -6500,11 +6517,11 @@ class VerticalEvent extends EventBase {
6500
6517
  const resources = this.getResourceList();
6501
6518
  let dateCount = this.getStartCount();
6502
6519
  for (const resource of resources) {
6503
- const renderDates = this.dateRender[resource];
6520
+ const renderDates = this.dateRender[parseInt(resource.toString(), 10)];
6504
6521
  for (let day = 0, length = renderDates.length; day < length; day++) {
6505
- const startDate = new Date(renderDates[day].getTime());
6506
- const endDate = addDays(renderDates[day], 1);
6507
- const filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[resource]);
6522
+ const startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
6523
+ const endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
6524
+ const filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[parseInt(resource.toString(), 10)]);
6508
6525
  for (const event of filterEvents) {
6509
6526
  if (this.parent.resourceBase) {
6510
6527
  this.setValues(event, resource);
@@ -6521,9 +6538,9 @@ class VerticalEvent extends EventBase {
6521
6538
  const spannedData = this.isSpannedEvent(eventObj, dayIndex, resource);
6522
6539
  const eStart = spannedData[this.fields.startTime];
6523
6540
  const eEnd = spannedData[this.fields.endTime];
6524
- const currentDate = resetTime(new Date(this.dateRender[resource][dayIndex].getTime()));
6541
+ const currentDate = resetTime(new Date(this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)].getTime()));
6525
6542
  const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
6526
- if (eStart <= eEnd && this.isValidEvent(eventObj, eStart, eEnd, schedule)) {
6543
+ if (eStart <= eEnd && this.isValidEvent(eventObj, eStart, eEnd, schedule) && this.isWorkDayAvailable(resource, eStart)) {
6527
6544
  let blockTop;
6528
6545
  let blockHeight;
6529
6546
  if (spannedData[this.fields.isAllDay]) {
@@ -6537,9 +6554,7 @@ class VerticalEvent extends EventBase {
6537
6554
  }
6538
6555
  const appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
6539
6556
  setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
6540
- const renderedIndex = this.getDayIndex(dayIndex, resource);
6541
- const index = this.parent.activeViewOptions.group.byDate ?
6542
- (this.resources.length * renderedIndex) + resource : dayCount;
6557
+ const index = this.getDayIndex(dayIndex, resource, dayCount);
6543
6558
  this.appendEvent(eventObj, appointmentElement, index, '0px');
6544
6559
  }
6545
6560
  }
@@ -6559,15 +6574,15 @@ class VerticalEvent extends EventBase {
6559
6574
  }
6560
6575
  }
6561
6576
  this.slots = [];
6562
- const renderDates = this.dateRender[resource];
6577
+ const renderDates = this.dateRender[parseInt(resource.toString(), 10)];
6563
6578
  const renderedDate = this.getRenderedDates(renderDates) || renderDates;
6564
6579
  this.slots.push(renderDates.map((date) => { return +date; }));
6565
6580
  for (let day = 0, length = renderDates.length; day < length &&
6566
- renderDates[day] <= renderedDate[renderedDate.length - 1]; day++) {
6581
+ renderDates[parseInt(day.toString(), 10)] <= renderedDate[renderedDate.length - 1]; day++) {
6567
6582
  this.renderedEvents = [];
6568
- const startDate = new Date(renderDates[day].getTime());
6569
- const endDate = addDays(renderDates[day], 1);
6570
- const filterEvents = this.filterEvents(startDate, endDate, eventCollection, this.resources[resource]);
6583
+ const startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
6584
+ const endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
6585
+ const filterEvents = this.filterEvents(startDate, endDate, eventCollection, this.resources[parseInt(resource.toString(), 10)]);
6571
6586
  if (isRender) {
6572
6587
  for (const event of filterEvents) {
6573
6588
  if (this.parent.resourceBase) {
@@ -6608,15 +6623,36 @@ class VerticalEvent extends EventBase {
6608
6623
  return this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.timeScale.enable ?
6609
6624
  parseInt(this.element.querySelector('.' + APPOINTMENT_WRAPPER_CLASS).getAttribute('id').split('-').slice(-1)[0], 10) : 0;
6610
6625
  }
6611
- getDayIndex(dayIndex, resource) {
6612
- return this.parent.activeViewOptions.group.byDate ?
6613
- this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[resource][dayIndex]) :
6614
- dayIndex;
6626
+ getDayIndex(dayIndex, resource, dayCount) {
6627
+ if (!this.parent.activeViewOptions.group.byDate) {
6628
+ return dayCount;
6629
+ }
6630
+ if (this.parent.activeViewOptions.group.byDate && !this.parent.activeViewOptions.group.hideNonWorkingDays) {
6631
+ const renderedIndex = this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)]);
6632
+ return (this.resources.length * renderedIndex) + resource;
6633
+ }
6634
+ let dateIndex = 0;
6635
+ const firstColumn = this.parent.activeView.colLevels[0];
6636
+ const currentDate = this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)].getTime();
6637
+ let currentResources = [];
6638
+ for (let i = 0; i < firstColumn.length; i++) {
6639
+ currentResources = this.parent.resourceBase.resourceDateTree[parseInt(i.toString(), 10)];
6640
+ if (currentDate === firstColumn[parseInt(i.toString(), 10)].date.getTime()) {
6641
+ break;
6642
+ }
6643
+ dateIndex = dateIndex + firstColumn[parseInt(i.toString(), 10)].colSpan;
6644
+ }
6645
+ const resIndex = currentResources.findIndex((x) => x.groupOrder.toString() ===
6646
+ this.resources[parseInt(resource.toString(), 10)].groupOrder.toString());
6647
+ if (resIndex < 0) {
6648
+ return dateIndex;
6649
+ }
6650
+ return dateIndex + resIndex;
6615
6651
  }
6616
6652
  setValues(event, resourceIndex) {
6617
6653
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6618
- this.cssClass = this.resources[resourceIndex].cssClass;
6619
- this.groupOrder = this.resources[resourceIndex].groupOrder;
6654
+ this.cssClass = this.resources[parseInt(resourceIndex.toString(), 10)].cssClass;
6655
+ this.groupOrder = this.resources[parseInt(resourceIndex.toString(), 10)].groupOrder;
6620
6656
  }
6621
6657
  else {
6622
6658
  this.cssClass = this.parent.resourceBase.getCssClass(event);
@@ -6729,7 +6765,7 @@ class VerticalEvent extends EventBase {
6729
6765
  }
6730
6766
  createMoreIndicator(allDayRow, count, currentDay) {
6731
6767
  const index = currentDay + count;
6732
- const countWrapper = allDayRow[index];
6768
+ const countWrapper = allDayRow[parseInt(index.toString(), 10)];
6733
6769
  if (countWrapper.childElementCount <= 0) {
6734
6770
  const innerCountWrap = createElement('div', {
6735
6771
  className: ROW_COUNT_WRAPPER_CLASS,
@@ -6775,8 +6811,8 @@ class VerticalEvent extends EventBase {
6775
6811
  }
6776
6812
  }
6777
6813
  isSpannedEvent(record, day, resource) {
6778
- let currentDate = resetTime(this.dateRender[resource][day]);
6779
- const renderedDate = this.getRenderedDates(this.dateRender[resource]) || [currentDate];
6814
+ let currentDate = resetTime(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)]);
6815
+ const renderedDate = this.getRenderedDates(this.dateRender[parseInt(resource.toString(), 10)]) || [currentDate];
6780
6816
  const currentDay = renderedDate.filter((date) => date.getDay() === day);
6781
6817
  if (currentDay.length === 0) {
6782
6818
  currentDate = resetTime(renderedDate[0]);
@@ -6798,11 +6834,21 @@ class VerticalEvent extends EventBase {
6798
6834
  event[field.endTime] = eventDates.endDate;
6799
6835
  return event;
6800
6836
  }
6837
+ isWorkDayAvailable(resource, start) {
6838
+ if (this.parent.activeViewOptions.group.hideNonWorkingDays && this.resources.length > 0) {
6839
+ const workDays = this.resources[parseInt(resource.toString(), 10)].
6840
+ resourceData[this.resources[parseInt(resource.toString(), 10)].resource.workDaysField] ||
6841
+ this.parent.activeViewOptions.workDays;
6842
+ return workDays && workDays.indexOf(start.getDay()) >= 0;
6843
+ }
6844
+ return true;
6845
+ }
6801
6846
  renderAllDayEvents(eventObj, dayIndex, resource, dayCount, inline) {
6802
- let currentDates = this.getRenderedDates(this.dateRender[resource]) || this.dateRender[resource];
6847
+ let currentDates = this.getRenderedDates(this.dateRender[parseInt(resource.toString(), 10)]) ||
6848
+ this.dateRender[parseInt(resource.toString(), 10)];
6803
6849
  if (this.parent.activeViewOptions.group.byDate) {
6804
- this.slots[0] = [this.dateRender[resource][dayIndex].getTime()];
6805
- currentDates = [this.dateRender[resource][dayIndex]];
6850
+ this.slots[0] = [this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)].getTime()];
6851
+ currentDates = [this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)]];
6806
6852
  }
6807
6853
  const record = this.splitEvent(eventObj, currentDates)[0];
6808
6854
  const allDayRowCell = this.element.querySelector('.' + ALLDAY_CELLS_CLASS + ':first-child');
@@ -6813,13 +6859,14 @@ class VerticalEvent extends EventBase {
6813
6859
  let topValue = 1;
6814
6860
  const isDateRange = currentDates[0].getTime() <= eStart.getTime() &&
6815
6861
  addDays(currentDates.slice(-1)[0], 1).getTime() >= eStart.getTime();
6816
- if (eStart <= eEnd && isDateRange) {
6862
+ if (eStart <= eEnd && isDateRange && this.isWorkDayAvailable(resource, eStart)) {
6817
6863
  let isAlreadyRendered = [];
6818
- if (this.renderedAllDayEvents[resource]) {
6819
- isAlreadyRendered = this.renderedAllDayEvents[resource].filter((event) => event.Guid === eventObj.Guid);
6864
+ if (this.renderedAllDayEvents[parseInt(resource.toString(), 10)]) {
6865
+ isAlreadyRendered = this.renderedAllDayEvents[parseInt(resource.toString(), 10)].filter((event) => event.Guid === eventObj.Guid);
6820
6866
  if (this.parent.activeViewOptions.group.byDate) {
6821
- isAlreadyRendered = isAlreadyRendered.filter((event) => event[this.parent.eventFields.startTime] >= currentDates[dayIndex] &&
6822
- event[this.parent.eventFields.endTime] <= addDays(new Date(+currentDates[dayIndex]), 1));
6867
+ isAlreadyRendered = isAlreadyRendered.filter((event) => event[this.parent.eventFields.startTime] >= currentDates[parseInt(dayIndex.toString(), 10)] &&
6868
+ event[this.parent.eventFields.endTime] <=
6869
+ addDays(new Date(+currentDates[parseInt(dayIndex.toString(), 10)]), 1));
6823
6870
  }
6824
6871
  }
6825
6872
  if (isAlreadyRendered.length === 0) {
@@ -6832,14 +6879,12 @@ class VerticalEvent extends EventBase {
6832
6879
  if (allDayDifference >= 0) {
6833
6880
  appWidth = (allDayDifference * 100) - widthAdjustment;
6834
6881
  }
6835
- if (isNullOrUndefined(this.renderedAllDayEvents[resource])) {
6836
- this.renderedAllDayEvents[resource] = [];
6882
+ if (isNullOrUndefined(this.renderedAllDayEvents[parseInt(resource.toString(), 10)])) {
6883
+ this.renderedAllDayEvents[parseInt(resource.toString(), 10)] = [];
6837
6884
  }
6838
- const renderedIndex = this.getDayIndex(dayIndex, resource);
6839
- this.renderedAllDayEvents[resource].push(extend({}, record, null, true));
6885
+ this.renderedAllDayEvents[parseInt(resource.toString(), 10)].push(extend({}, record, null, true));
6840
6886
  const allDayRow = [].slice.call(this.element.querySelector('.' + ALLDAY_ROW_CLASS).children);
6841
- const wIndex = this.parent.activeViewOptions.group.byDate ?
6842
- (this.resources.length * renderedIndex) + resource : dayCount;
6887
+ const wIndex = this.getDayIndex(dayIndex, resource, dayCount);
6843
6888
  const eventWrapper = this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS +
6844
6889
  ':nth-child(' + (wIndex + 1) + ')');
6845
6890
  let appointmentElement;
@@ -6883,13 +6928,13 @@ class VerticalEvent extends EventBase {
6883
6928
  let appWidth = '0%';
6884
6929
  const appLeft = '0%';
6885
6930
  let topValue = 0;
6886
- const currentDate = resetTime(new Date(this.dateRender[resource][dayIndex].getTime()));
6931
+ const currentDate = resetTime(new Date(this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)].getTime()));
6887
6932
  const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
6888
6933
  const isValidEvent = this.isValidEvent(eventObj, eStart, eEnd, schedule);
6889
6934
  if ((eStart.getTime() < this.parent.minDate.getTime()) || (eEnd.getTime() > this.parent.maxDate.getTime())) {
6890
6935
  return;
6891
6936
  }
6892
- if (eStart <= eEnd && isValidEvent) {
6937
+ if (eStart <= eEnd && isValidEvent && this.isWorkDayAvailable(resource, eStart)) {
6893
6938
  const appHeight = this.getHeight(eStart, eEnd);
6894
6939
  if (eStart.getTime() > schedule.startHour.getTime()) {
6895
6940
  topValue = this.getTopValue(eStart, dayIndex, resource);
@@ -6898,27 +6943,26 @@ class VerticalEvent extends EventBase {
6898
6943
  record.Index = appIndex;
6899
6944
  this.overlapList.push(record);
6900
6945
  if (this.overlapList.length > 1) {
6901
- if (isNullOrUndefined(this.overlapEvents[appIndex])) {
6902
- this.overlapEvents[appIndex] = [];
6946
+ if (isNullOrUndefined(this.overlapEvents[parseInt(appIndex.toString(), 10)])) {
6947
+ this.overlapEvents[parseInt(appIndex.toString(), 10)] = [];
6903
6948
  }
6904
- this.overlapEvents[appIndex].push(record);
6949
+ this.overlapEvents[parseInt(appIndex.toString(), 10)].push(record);
6905
6950
  }
6906
6951
  else {
6907
6952
  this.overlapEvents = [];
6908
6953
  this.overlapEvents.push([record]);
6909
6954
  }
6910
6955
  appWidth = this.getEventWidth();
6911
- const renderedIndex = this.getDayIndex(dayIndex, resource);
6912
6956
  const argsData = {
6913
6957
  index: appIndex, left: appLeft, width: appWidth,
6914
- day: renderedIndex, dayIndex: dayCount, record: record, resource: resource
6958
+ day: dayCount, dayIndex: dayIndex, record: record, resource: resource
6915
6959
  };
6916
6960
  const tempData = this.adjustOverlapElements(argsData);
6917
6961
  appWidth = (tempData.appWidth);
6918
- if (isNullOrUndefined(this.renderedEvents[resource])) {
6919
- this.renderedEvents[resource] = [];
6962
+ if (isNullOrUndefined(this.renderedEvents[parseInt(resource.toString(), 10)])) {
6963
+ this.renderedEvents[parseInt(resource.toString(), 10)] = [];
6920
6964
  }
6921
- this.renderedEvents[resource].push(extend({}, record, null, true));
6965
+ this.renderedEvents[parseInt(resource.toString(), 10)].push(extend({}, record, null, true));
6922
6966
  let appointmentElement;
6923
6967
  if (inline) {
6924
6968
  appointmentElement = this.parent.inlineModule.createInlineAppointmentElement(eventObj);
@@ -6936,8 +6980,7 @@ class VerticalEvent extends EventBase {
6936
6980
  if (!this.parent.isAdaptive && subjectElement) {
6937
6981
  subjectElement.style.maxHeight = formatUnit(maxHeight);
6938
6982
  }
6939
- const index = this.parent.activeViewOptions.group.byDate ?
6940
- (this.resources.length * renderedIndex) + resource : dayCount;
6983
+ const index = this.getDayIndex(dayIndex, resource, dayCount);
6941
6984
  const eventData = {};
6942
6985
  eventData[this.fields.startTime] = eventObj[this.fields.startTime];
6943
6986
  eventData[this.fields.endTime] = eventObj[this.fields.endTime];
@@ -6962,7 +7005,7 @@ class VerticalEvent extends EventBase {
6962
7005
  return (tempLeft > 99 ? 99 : tempLeft) + '%';
6963
7006
  }
6964
7007
  getTopValue(date, day, resource) {
6965
- const startEndHours = getStartEndHours(resetTime(this.dateRender[resource][day]), this.startHour, this.endHour);
7008
+ const startEndHours = getStartEndHours(resetTime(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)]), this.startHour, this.endHour);
6966
7009
  const startHour = startEndHours.startHour;
6967
7010
  const diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
6968
7011
  return (this.parent.activeViewOptions.timeScale.enable) ? ((diffInMinutes * this.cellHeight * this.slotCount) / this.interval) : 0;
@@ -6973,18 +7016,18 @@ class VerticalEvent extends EventBase {
6973
7016
  let appIndex = -1;
6974
7017
  this.overlapEvents = [];
6975
7018
  if (isAllDay) {
6976
- if (!isNullOrUndefined(this.renderedAllDayEvents[resource])) {
6977
- const date = resetTime(new Date(this.dateRender[resource][day].getTime()));
6978
- eventsList = this.renderedAllDayEvents[resource].filter((app) => resetTime(app[fieldMapping.startTime]).getTime() <= date.getTime() &&
7019
+ if (!isNullOrUndefined(this.renderedAllDayEvents[parseInt(resource.toString(), 10)])) {
7020
+ const date = resetTime(new Date(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)].getTime()));
7021
+ eventsList = this.renderedAllDayEvents[parseInt(resource.toString(), 10)].filter((app) => resetTime(app[fieldMapping.startTime]).getTime() <= date.getTime() &&
6979
7022
  resetTime(app[fieldMapping.endTime]).getTime() >= date.getTime());
6980
7023
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6981
- eventsList = this.filterEventsByResource(this.resources[resource], eventsList);
7024
+ eventsList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], eventsList);
6982
7025
  }
6983
7026
  }
6984
7027
  }
6985
7028
  else {
6986
- const appointmentList = !isNullOrUndefined(this.renderedEvents[resource]) ?
6987
- this.renderedEvents[resource] : [];
7029
+ const appointmentList = !isNullOrUndefined(this.renderedEvents[parseInt(resource.toString(), 10)]) ?
7030
+ this.renderedEvents[parseInt(resource.toString(), 10)] : [];
6988
7031
  let appointment = [];
6989
7032
  const recordStart = record[fieldMapping.startTime];
6990
7033
  const recordEnd = record[fieldMapping.endTime];
@@ -6993,12 +7036,12 @@ class VerticalEvent extends EventBase {
6993
7036
  (data[fieldMapping.endTime].getTime() === data[fieldMapping.startTime].getTime() &&
6994
7037
  data[fieldMapping.startTime].getTime() === recordStart.getTime() && data[fieldMapping.endTime] < recordEnd));
6995
7038
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6996
- this.overlapList = this.filterEventsByResource(this.resources[resource], this.overlapList);
7039
+ this.overlapList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], this.overlapList);
6997
7040
  }
6998
7041
  this.overlapList.forEach((obj) => {
6999
7042
  let filterList = appointmentList.filter((data) => data[fieldMapping.endTime] > obj[fieldMapping.startTime] && data[fieldMapping.startTime] <= obj[fieldMapping.endTime]);
7000
7043
  if (this.parent.activeViewOptions.group.resources.length > 0) {
7001
- filterList = this.filterEventsByResource(this.resources[resource], filterList);
7044
+ filterList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], filterList);
7002
7045
  }
7003
7046
  const collection = filterList.filter((val) => this.overlapList.indexOf(val) === -1);
7004
7047
  if (collection.length > 0) {
@@ -7007,7 +7050,8 @@ class VerticalEvent extends EventBase {
7007
7050
  });
7008
7051
  for (let i = 0; i < appointment.length - 1; i++) {
7009
7052
  for (let j = i + 1; j < appointment.length; j++) {
7010
- if (appointment[i][fieldMapping.id] === appointment[j][fieldMapping.id]) {
7053
+ if (appointment[parseInt(i.toString(), 10)][fieldMapping.id] ===
7054
+ appointment[parseInt(j.toString(), 10)][fieldMapping.id]) {
7011
7055
  appointment.splice(j, 1);
7012
7056
  j--;
7013
7057
  }
@@ -7018,11 +7062,11 @@ class VerticalEvent extends EventBase {
7018
7062
  for (const event of eventsList) {
7019
7063
  const record = event;
7020
7064
  const index = record.Index;
7021
- if (isNullOrUndefined(this.overlapEvents[index])) {
7022
- this.overlapEvents[index] = [event];
7065
+ if (isNullOrUndefined(this.overlapEvents[parseInt(index.toString(), 10)])) {
7066
+ this.overlapEvents[parseInt(index.toString(), 10)] = [event];
7023
7067
  }
7024
7068
  else {
7025
- this.overlapEvents[index].push(event);
7069
+ this.overlapEvents[parseInt(index.toString(), 10)].push(event);
7026
7070
  }
7027
7071
  }
7028
7072
  }
@@ -7046,13 +7090,12 @@ class VerticalEvent extends EventBase {
7046
7090
  adjustOverlapElements(args) {
7047
7091
  const data = { appWidth: args.width, appLeft: args.left };
7048
7092
  for (let i = 0, length1 = this.overlapEvents.length; i < length1; i++) {
7049
- if (!isNullOrUndefined(this.overlapEvents[i])) {
7050
- for (let j = 0, length2 = this.overlapEvents[i].length; j < length2; j++) {
7051
- const dayCount = this.parent.activeViewOptions.group.byDate ?
7052
- (this.resources.length * args.day) + args.resource : args.dayIndex;
7093
+ if (!isNullOrUndefined(this.overlapEvents[parseInt(i.toString(), 10)])) {
7094
+ for (let j = 0, length2 = this.overlapEvents[parseInt(i.toString(), 10)].length; j < length2; j++) {
7095
+ const dayCount = this.getDayIndex(args.dayIndex, args.resource, args.day);
7053
7096
  const element = this.element.querySelector('#e-appointment-wrapper-' + dayCount);
7054
7097
  if (element && element.childElementCount > 0) {
7055
- const eleGuid = this.overlapEvents[i][j].Guid;
7098
+ const eleGuid = this.overlapEvents[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].Guid;
7056
7099
  if (element.querySelectorAll('div[data-guid="' + eleGuid + '"]').length > 0 && eleGuid !== args.record.Guid) {
7057
7100
  const apps = element.querySelector('div[data-guid="' + eleGuid + '"]');
7058
7101
  if (parseFloat(args.width) <= parseFloat(apps.style.width)) {
@@ -7212,7 +7255,8 @@ class MonthEvent extends EventBase {
7212
7255
  }
7213
7256
  removeEventWrapper(appElement) {
7214
7257
  if (appElement.length > 0) {
7215
- appElement = (this.parent.currentView === 'Month') ? appElement : [appElement[0]];
7258
+ appElement = (this.parent.currentView === 'Month' || (!this.parent.activeView.isTimelineView() &&
7259
+ !this.parent.activeViewOptions.timeScale.enable)) ? appElement : [appElement[0]];
7216
7260
  for (const wrap of appElement) {
7217
7261
  if (wrap.parentElement && wrap.parentElement.parentNode) {
7218
7262
  remove(wrap.parentElement);
@@ -7234,12 +7278,13 @@ class MonthEvent extends EventBase {
7234
7278
  if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
7235
7279
  for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
7236
7280
  const appElement = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index="' +
7237
- this.parent.crudModule.crudObj.sourceEvent[i].groupIndex + '"]'));
7281
+ this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex + '"]'));
7238
7282
  this.removeEventWrapper(appElement);
7239
- if (this.parent.crudModule.crudObj.targetEvent[i] && this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
7240
- this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
7283
+ if (this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)] &&
7284
+ this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
7285
+ this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
7241
7286
  const ele = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index="' +
7242
- this.parent.crudModule.crudObj.targetEvent[i].groupIndex + '"]'));
7287
+ this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex + '"]'));
7243
7288
  this.removeEventWrapper(ele);
7244
7289
  }
7245
7290
  }
@@ -7300,7 +7345,7 @@ class MonthEvent extends EventBase {
7300
7345
  const totalCells = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
7301
7346
  const weekNumberCells = [].slice.call(this.parent.element.querySelectorAll('.' + WEEK_NUMBER_CLASS));
7302
7347
  weekNumberCells.forEach((cell, i) => {
7303
- const height = totalCells[i].offsetHeight;
7348
+ const height = totalCells[parseInt(i.toString(), 10)].offsetHeight;
7304
7349
  setStyleAttribute(cell, { 'height': height + 'px' });
7305
7350
  });
7306
7351
  this.parent.element.querySelector('.' + WEEK_NUMBER_WRAPPER_CLASS).scrollTop =
@@ -7353,7 +7398,7 @@ class MonthEvent extends EventBase {
7353
7398
  }
7354
7399
  for (let level = 0; level < this.slots.length; level++) {
7355
7400
  this.renderedEvents = [];
7356
- const slot = this.slots[level];
7401
+ const slot = this.slots[parseInt(level.toString(), 10)];
7357
7402
  const endDate = addDays(new Date(slot[slot.length - 1]), 1);
7358
7403
  const spannedEvents = this.filterEvents(new Date(slot[0]), endDate, events);
7359
7404
  for (const event of spannedEvents) {
@@ -7457,7 +7502,7 @@ class MonthEvent extends EventBase {
7457
7502
  return event[this.fields.endTime];
7458
7503
  }
7459
7504
  getCellTd(day) {
7460
- return this.workCells[day];
7505
+ return this.workCells[parseInt(day.toString(), 10)];
7461
7506
  }
7462
7507
  getEventWidth(startDate, endDate, isAllDay, count) {
7463
7508
  return count * this.cellWidth - 1;
@@ -7504,11 +7549,11 @@ class MonthEvent extends EventBase {
7504
7549
  this.parent.resourceBase.renderedResources;
7505
7550
  if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
7506
7551
  for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
7507
- const sourceRes = this.parent.crudModule.crudObj.sourceEvent[i];
7552
+ const sourceRes = this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)];
7508
7553
  this.renderEventsHandler(sourceRes.renderDates, sourceRes.workDays, sourceRes);
7509
- if (this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
7510
- this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
7511
- const target = this.parent.crudModule.crudObj.targetEvent[i];
7554
+ if (this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
7555
+ this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
7556
+ const target = this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)];
7512
7557
  this.renderEventsHandler(target.renderDates, target.workDays, target);
7513
7558
  }
7514
7559
  }
@@ -7523,7 +7568,8 @@ class MonthEvent extends EventBase {
7523
7568
  getSlotDates(workDays) {
7524
7569
  this.slots = [];
7525
7570
  const dates = this.dateRender.map((date) => { return +date; });
7526
- const noOfDays = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH : workDays.length;
7571
+ const noOfDays = !this.parent.activeViewOptions.showWeekend || (this.parent.activeViewOptions.group.byDate &&
7572
+ this.parent.activeViewOptions.group.hideNonWorkingDays) ? workDays.length : WEEK_LENGTH;
7527
7573
  while (dates.length > 0) {
7528
7574
  this.slots.push(dates.splice(0, noOfDays));
7529
7575
  }
@@ -7659,7 +7705,7 @@ class MonthEvent extends EventBase {
7659
7705
  const diffInDays = event.data.count;
7660
7706
  if (startTime.getTime() <= endTime.getTime()) {
7661
7707
  const appWidth = (diffInDays * this.cellWidth) - 5;
7662
- const cellTd = this.workCells[day];
7708
+ const cellTd = this.workCells[parseInt(day.toString(), 10)];
7663
7709
  const appTop = (overlapCount * (this.eventHeight + EVENT_GAP));
7664
7710
  const height = this.monthHeaderHeight + ((overlapCount + 1) * (this.eventHeight + EVENT_GAP)) + this.moreIndicatorHeight;
7665
7711
  const enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
@@ -7950,12 +7996,12 @@ class TimelineEvent extends MonthEvent {
7950
7996
  this.parent.resourceBase.renderedResources;
7951
7997
  if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
7952
7998
  for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
7953
- const source = this.parent.crudModule.crudObj.sourceEvent[i];
7999
+ const source = this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)];
7954
8000
  this.rowIndex = source.groupIndex;
7955
8001
  this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, source);
7956
- if (this.parent.crudModule.crudObj.targetEvent[i] && this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
7957
- this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
7958
- const target = this.parent.crudModule.crudObj.targetEvent[i];
8002
+ if (this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)] && this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
8003
+ this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
8004
+ const target = this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)];
7959
8005
  this.rowIndex = target.groupIndex;
7960
8006
  this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, target);
7961
8007
  }
@@ -7965,7 +8011,7 @@ class TimelineEvent extends MonthEvent {
7965
8011
  else {
7966
8012
  for (let i = 0; i < resources.length; i++) {
7967
8013
  this.rowIndex = i;
7968
- this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, resources[i]);
8014
+ this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, resources[parseInt(i.toString(), 10)]);
7969
8015
  }
7970
8016
  }
7971
8017
  }
@@ -8011,10 +8057,10 @@ class TimelineEvent extends MonthEvent {
8011
8057
  const position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], this.day);
8012
8058
  appWidth = (appWidth <= 0) ? this.cellWidth : appWidth; // appWidth 0 when start and end time as same
8013
8059
  this.renderedEvents.push(extend({}, event, null, true));
8014
- if (isNullOrUndefined(this.cellTops[resIndex])) {
8015
- this.cellTops[resIndex] = this.getRowTop(resIndex);
8060
+ if (isNullOrUndefined(this.cellTops[parseInt(resIndex.toString(), 10)])) {
8061
+ this.cellTops[parseInt(resIndex.toString(), 10)] = this.getRowTop(resIndex);
8016
8062
  }
8017
- const top = this.cellTops[resIndex];
8063
+ const top = this.cellTops[parseInt(resIndex.toString(), 10)];
8018
8064
  const appTop = (top + (this.maxHeight ? 0 : EVENT_GAP$1)) + (overlapCount * (appHeight + EVENT_GAP$1));
8019
8065
  appLeft = (this.parent.enableRtl) ? 0 : position;
8020
8066
  appRight = (this.parent.enableRtl) ? position : 0;
@@ -8278,7 +8324,7 @@ class TimelineEvent extends MonthEvent {
8278
8324
  if (this.renderType === 'day' || isAllDay) {
8279
8325
  return (day * this.slotsPerDay) * this.cellWidth;
8280
8326
  }
8281
- const currentDate = resetTime(new Date(this.dateRender[day].getTime()));
8327
+ const currentDate = resetTime(new Date(this.dateRender[parseInt(day.toString(), 10)].getTime()));
8282
8328
  const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
8283
8329
  let cellIndex;
8284
8330
  if (schedule.endHour.getTime() <= endTime.getTime() && schedule.startHour.getTime() >= startTime.getTime()) {
@@ -8308,7 +8354,7 @@ class TimelineEvent extends MonthEvent {
8308
8354
  for (let i = 0; i < moreIndicator.length; i++) {
8309
8355
  let indicatorPos;
8310
8356
  if (moreIndicator) {
8311
- indicatorPos = (this.parent.enableRtl) ? moreIndicator[i].style.right : moreIndicator[i].style.left;
8357
+ indicatorPos = (this.parent.enableRtl) ? moreIndicator[parseInt(i.toString(), 10)].style.right : moreIndicator[parseInt(i.toString(), 10)].style.left;
8312
8358
  }
8313
8359
  if (parseInt(indicatorPos, 10) === Math.floor(appPos)) {
8314
8360
  return true;
@@ -8325,7 +8371,7 @@ class TimelineEvent extends MonthEvent {
8325
8371
  }
8326
8372
  getCellTd() {
8327
8373
  const wrapIndex = this.parent.uiStateValues.isGroupAdaptive ? 0 : this.rowIndex;
8328
- return this.eventContainers[wrapIndex];
8374
+ return this.eventContainers[parseInt(wrapIndex.toString(), 10)];
8329
8375
  }
8330
8376
  renderBlockIndicator(cellTd, position, resIndex) {
8331
8377
  // No need to render block icon for Year, Month and Week header rows
@@ -8415,11 +8461,12 @@ class InlineEdit {
8415
8461
  const start = resetTime(new Date('' + saveObj[this.parent.eventFields.startTime])).getTime();
8416
8462
  const end = resetTime(new Date('' + saveObj[this.parent.eventFields.endTime])).getTime();
8417
8463
  const resIndex = args.groupIndex || 0;
8418
- if (this.parent.currentView === 'Day' || this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek') {
8464
+ const isVertical = this.parent.currentView === 'Day' || this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek';
8465
+ if (this.parent.activeViewOptions.timeScale.enable && isVertical) {
8419
8466
  const dayIndex = saveObj[this.parent.eventFields.startTime].getDay();
8420
8467
  this.createVerticalViewInline(saveObj, dayIndex, resIndex, cellIndex);
8421
8468
  }
8422
- else if (this.parent.currentView === 'Month') {
8469
+ else if (this.parent.currentView === 'Month' || (!this.parent.activeViewOptions.timeScale.enable && isVertical)) {
8423
8470
  this.createMonthViewInline(saveObj, resIndex, start, end);
8424
8471
  }
8425
8472
  else {
@@ -8468,7 +8515,7 @@ class InlineEdit {
8468
8515
  const count = this.getEventDaysCount(saveObj);
8469
8516
  const verticalEvent = new VerticalEvent(this.parent);
8470
8517
  verticalEvent.initializeValues();
8471
- const index = verticalEvent.dateRender[resIndex].map((date) => date.getDay()).indexOf(dayIndex);
8518
+ const index = verticalEvent.dateRender[parseInt(resIndex.toString(), 10)].map((date) => date.getDay()).indexOf(dayIndex);
8472
8519
  if (count >= 1) {
8473
8520
  verticalEvent.allDayElement = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_CELLS_CLASS));
8474
8521
  verticalEvent.slots.push(...this.parent.activeView.renderDates.map((date) => +date));
@@ -8496,14 +8543,16 @@ class InlineEdit {
8496
8543
  let monthCellSelector = '.' + WORK_CELLS_CLASS;
8497
8544
  if (this.parent.activeViewOptions.group.resources.length > 0) {
8498
8545
  monthCellSelector += '[data-group-index="' + index + '"]';
8499
- const resourceData = this.parent.resourceBase.lastResourceLevel[index];
8546
+ const resourceData = this.parent.resourceBase.lastResourceLevel[parseInt(index.toString(), 10)];
8500
8547
  renderDates = resourceData.renderDates;
8501
8548
  workDays = resourceData.workDays;
8502
8549
  }
8550
+ monthEvent.dateRender = renderDates;
8503
8551
  monthEvent.workCells = [].slice.call(this.parent.element.querySelectorAll(monthCellSelector));
8504
8552
  monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
8505
8553
  monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
8506
- monthEvent.eventHeight = getElementHeightFromClass(this.parent.monthModule.element, APPOINTMENT_CLASS);
8554
+ monthEvent.eventHeight =
8555
+ getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
8507
8556
  monthEvent.getSlotDates(workDays);
8508
8557
  const filteredDates = monthEvent.getRenderedDates(renderDates);
8509
8558
  const spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
@@ -9411,9 +9460,9 @@ class QuickPopups {
9411
9460
  let resourceData;
9412
9461
  let lastResource;
9413
9462
  for (let i = this.parent.resourceBase.resourceCollection.length - 1; i >= 0; i--) {
9414
- resourceData = eventData[this.parent.resourceBase.resourceCollection[i].field];
9463
+ resourceData = eventData[this.parent.resourceBase.resourceCollection[parseInt(i.toString(), 10)].field];
9415
9464
  if (!isNullOrUndefined(resourceData)) {
9416
- lastResource = this.parent.resourceBase.resourceCollection[i];
9465
+ lastResource = this.parent.resourceBase.resourceCollection[parseInt(i.toString(), 10)];
9417
9466
  break;
9418
9467
  }
9419
9468
  }
@@ -9426,7 +9475,7 @@ class QuickPopups {
9426
9475
  let text;
9427
9476
  const i = findIndexInData(lastResourceData, lastResource.idField, value);
9428
9477
  if (i > -1) {
9429
- text = lastResourceData[i][lastResource.textField];
9478
+ text = lastResourceData[parseInt(i.toString(), 10)][lastResource.textField];
9430
9479
  }
9431
9480
  if (text) {
9432
9481
  resNames.push(text);
@@ -9437,7 +9486,7 @@ class QuickPopups {
9437
9486
  else {
9438
9487
  const argsData = args;
9439
9488
  const groupIndex = !isNullOrUndefined(argsData.groupIndex) ? argsData.groupIndex : 0;
9440
- const resourceDetails = this.parent.resourceBase.lastResourceLevel[groupIndex];
9489
+ const resourceDetails = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex.toString(), 10)];
9441
9490
  resourceValue = resourceDetails.resourceData[resourceDetails.resource.textField];
9442
9491
  }
9443
9492
  }
@@ -9513,9 +9562,9 @@ class QuickPopups {
9513
9562
  const workCells = [].slice.call(this.parent.element.querySelectorAll('.' + CONTENT_WRAP_CLASS +
9514
9563
  ' tbody tr td[data-group-index="' + gIndex + '"]'));
9515
9564
  for (let i = 0; i < workCells.length; i++) {
9516
- const date = workCells[i].getAttribute('data-date');
9565
+ const date = workCells[parseInt(i.toString(), 10)].getAttribute('data-date');
9517
9566
  if (date < tdDate) {
9518
- this.morePopup.relateTo = workCells[i];
9567
+ this.morePopup.relateTo = workCells[parseInt(i.toString(), 10)];
9519
9568
  }
9520
9569
  }
9521
9570
  }
@@ -10077,12 +10126,13 @@ class EventTooltip {
10077
10126
  let resCollection;
10078
10127
  if (this.parent.activeView.isTimelineView()) {
10079
10128
  const index = parseInt(args.target.getAttribute('data-group-index'), 10);
10080
- resCollection = this.parent.resourceBase.lastResourceLevel[index];
10129
+ resCollection = this.parent.resourceBase.lastResourceLevel[parseInt(index.toString(), 10)];
10081
10130
  }
10082
10131
  else {
10083
10132
  const rowIndex = args.target.parentNode.sectionRowIndex;
10084
10133
  const cellIndex = args.target.cellIndex;
10085
- resCollection = this.parent.activeView.getColumnLevels()[rowIndex][cellIndex];
10134
+ resCollection =
10135
+ this.parent.activeView.getColumnLevels()[parseInt(rowIndex.toString(), 10)][parseInt(cellIndex.toString(), 10)];
10086
10136
  }
10087
10137
  const data = {
10088
10138
  resource: resCollection.resource,
@@ -10818,7 +10868,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10818
10868
  const self = this;
10819
10869
  const dataSource = [];
10820
10870
  monthpos.forEach((data) => {
10821
- dataSource.push({ text: self.localeObj.getConstant(data), value: monthposValue[data] });
10871
+ dataSource.push({ text: self.localeObj.getConstant(data), value: monthposValue[`${data}`] });
10822
10872
  });
10823
10873
  return dataSource;
10824
10874
  }
@@ -10837,7 +10887,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10837
10887
  }
10838
10888
  for (const obj of weekday) {
10839
10889
  const day = getValue(obj, cldrObj);
10840
- dayData.push({ text: format === 'narrow' ? day : capitalizeFirstWord(day, 'single'), value: valueData[obj] });
10890
+ dayData.push({ text: format === 'narrow' ? day : capitalizeFirstWord(day, 'single'), value: valueData[`${obj}`] });
10841
10891
  }
10842
10892
  return dayData;
10843
10893
  }
@@ -10926,7 +10976,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10926
10976
  const weekday = [RULESUNDAY, RULEMONDAY, RULETUESDAY, RULEWEDNESDAY, RULETHURSDAY, RULEFRIDAY, RULESATURDAY];
10927
10977
  this.rotateArray(weekday, this.firstDayOfWeek);
10928
10978
  for (let index = 0; index < elements.length; index++) {
10929
- ruleData += weekday[parseInt(elements[index].getAttribute('data-index'), 10)] + (index === (elements.length - 1) ? '' : COMMA);
10979
+ ruleData += weekday[parseInt(elements[parseInt(index.toString(), 10)].getAttribute('data-index'), 10)] + (index === (elements.length - 1) ? '' : COMMA);
10930
10980
  }
10931
10981
  return ruleData + SEMICOLON;
10932
10982
  }
@@ -10955,7 +11005,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10955
11005
  this.rotateArray(weekday, this.firstDayOfWeek);
10956
11006
  for (const obj of this.dayButtons) {
10957
11007
  const index = parseInt(obj.element.getAttribute('data-index'), 10);
10958
- if (keys.indexOf(weekday[index]) !== -1) {
11008
+ if (keys.indexOf(weekday[parseInt(index.toString(), 10)]) !== -1) {
10959
11009
  obj.setProperties({ isPrimary: true });
10960
11010
  }
10961
11011
  else {
@@ -10972,7 +11022,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10972
11022
  this.onWeekDay.setProperties({ checked: true });
10973
11023
  this.monthWeekPos.setProperties({ value: this.ruleObject.setPosition });
10974
11024
  for (const key of Object.keys(valueData)) {
10975
- if (valueData[key] === this.ruleObject.day[0]) {
11025
+ if (valueData[`${key}`] === this.ruleObject.day[0]) {
10976
11026
  this.monthWeekDays.setProperties({ value: this.ruleObject.day[0] });
10977
11027
  break;
10978
11028
  }
@@ -11769,13 +11819,13 @@ class EventWindow {
11769
11819
  const resourceCollection = this.parent.resourceBase.resourceCollection;
11770
11820
  const fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);
11771
11821
  for (let i = 0; i < resourceCollection.length; i++) {
11772
- if (resourceCollection[i].field === fieldName && i < resourceCollection.length - 1) {
11822
+ if (resourceCollection[parseInt(i.toString(), 10)].field === fieldName && i < resourceCollection.length - 1) {
11773
11823
  const resObject = this.createInstance(i);
11774
11824
  let datasource = [];
11775
11825
  for (let j = 0; j < args.value.length; j++) {
11776
11826
  const resourceModel = resourceCollection[i + 1];
11777
11827
  // eslint-disable-next-line max-len
11778
- const filter = resourceModel.dataSource.filter((data) => data[resourceModel.groupIDField] === args.value[j])[0];
11828
+ const filter = resourceModel.dataSource.filter((data) => data[resourceModel.groupIDField] === args.value[parseInt(j.toString(), 10)])[0];
11779
11829
  const groupId = (!isNullOrUndefined(filter)) ?
11780
11830
  filter[resourceCollection[i + 1].groupIDField] : null;
11781
11831
  const filterRes = this.filterDatasource(i, groupId);
@@ -11800,9 +11850,9 @@ class EventWindow {
11800
11850
  const fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);
11801
11851
  const resourceCollection = this.parent.resourceBase.resourceCollection;
11802
11852
  for (let i = 0; i < resourceCollection.length; i++) {
11803
- if ((i < resourceCollection.length - 1) && resourceCollection[i].field === fieldName) {
11853
+ if ((i < resourceCollection.length - 1) && resourceCollection[parseInt(i.toString(), 10)].field === fieldName) {
11804
11854
  const resObj = this.createInstance(i);
11805
- const groupId = args.itemData[resourceCollection[i].idField];
11855
+ const groupId = args.itemData[resourceCollection[parseInt(i.toString(), 10)].idField];
11806
11856
  resObj.dataSource = this.filterDatasource(i, groupId);
11807
11857
  resObj.dataBind();
11808
11858
  const resValue = (resObj.dataSource.length > 0) ?
@@ -12122,7 +12172,7 @@ class EventWindow {
12122
12172
  const columnName = curElement.name || this.getColumnName(curElement);
12123
12173
  if (!isNullOrUndefined(columnName) && columnName !== '') {
12124
12174
  if (keyNames.indexOf(columnName) !== -1) {
12125
- this.setValueToElement(curElement, eventObj[columnName]);
12175
+ this.setValueToElement(curElement, eventObj[`${columnName}`]);
12126
12176
  }
12127
12177
  else {
12128
12178
  this.setDefaultValueToElement(curElement);
@@ -12562,7 +12612,7 @@ class EventWindow {
12562
12612
  for (const currentElement of formElement) {
12563
12613
  const columnName = currentElement.name || this.getColumnName(currentElement);
12564
12614
  if (!isNullOrUndefined(columnName) && columnName !== '') {
12565
- eventObj[columnName] = this.getValueFromElement(currentElement);
12615
+ eventObj[`${columnName}`] = this.getValueFromElement(currentElement);
12566
12616
  }
12567
12617
  }
12568
12618
  return eventObj;
@@ -12624,11 +12674,13 @@ class EventWindow {
12624
12674
  case 'WEEKLY':
12625
12675
  types = recEditor.value.split(';')[1].split('=')[1].split(',');
12626
12676
  for (let index = 0; index < types.length * (interval + 1); index++) {
12627
- temp[index] = (types.length > index) ? obj[types[index]] : temp[index - types.length] + (7 * interval);
12677
+ temp[parseInt(index.toString(), 10)] =
12678
+ (types.length > index) ? obj[types[parseInt(index.toString(), 10)]] :
12679
+ temp[index - types.length] + (7 * interval);
12628
12680
  }
12629
12681
  tempValue = temp.sort((a, b) => a - b);
12630
12682
  for (let index = 1; index < tempValue.length; index++) {
12631
- tempDiff.push(tempValue[index] - tempValue[index - 1]);
12683
+ tempDiff.push(tempValue[parseInt(index.toString(), 10)] - tempValue[index - 1]);
12632
12684
  }
12633
12685
  if ((((endDate.getTime() - startDate.getTime()) / (1000 * 3600)) >= Math.min(...tempDiff) * 24)
12634
12686
  || isNullOrUndefined(interval)) {
@@ -12664,7 +12716,7 @@ class EventWindow {
12664
12716
  getRecurrenceIndex(recColl, event) {
12665
12717
  let recIndex;
12666
12718
  for (let index = 0; index < recColl.length; index++) {
12667
- if (event[this.fields.startTime].valueOf() === recColl[index][this.fields.startTime].valueOf()) {
12719
+ if (event[this.fields.startTime].valueOf() === recColl[parseInt(index.toString(), 10)][this.fields.startTime].valueOf()) {
12668
12720
  recIndex = index;
12669
12721
  break;
12670
12722
  }
@@ -12762,8 +12814,8 @@ class EventWindow {
12762
12814
  if (temp.length > 0) {
12763
12815
  temp[0][this.fields.id] = eventObj[this.fields.id];
12764
12816
  for (let k = 1; k < temp.length; k++) {
12765
- temp[k][this.fields.id] = this.parent.eventBase.getEventMaxID(i);
12766
- eventList.push(temp[k]);
12817
+ temp[parseInt(k.toString(), 10)][this.fields.id] = this.parent.eventBase.getEventMaxID(i);
12818
+ eventList.push(temp[parseInt(k.toString(), 10)]);
12767
12819
  this.parent.saveEvent(temp[0], currentAction);
12768
12820
  }
12769
12821
  }
@@ -12775,8 +12827,8 @@ class EventWindow {
12775
12827
  else {
12776
12828
  if (temp.length > 0) {
12777
12829
  for (let j = 0; j < temp.length; j++) {
12778
- temp[j][this.fields.id] = this.parent.eventBase.getEventMaxID(j);
12779
- eventList.push(temp[j]);
12830
+ temp[parseInt(j.toString(), 10)][this.fields.id] = this.parent.eventBase.getEventMaxID(j);
12831
+ eventList.push(temp[parseInt(j.toString(), 10)]);
12780
12832
  }
12781
12833
  }
12782
12834
  else {
@@ -12790,50 +12842,54 @@ class EventWindow {
12790
12842
  const resCol = this.parent.resourceCollection;
12791
12843
  let index;
12792
12844
  if (resCol.length > 1) {
12793
- index = findIndexInData(lastResource, lastResourceData.idField, resourceData[i], events, resCol);
12845
+ index =
12846
+ findIndexInData(lastResource, lastResourceData.idField, resourceData[parseInt(i.toString(), 10)], events, resCol);
12794
12847
  }
12795
12848
  else {
12796
- index = findIndexInData(lastResource, lastResourceData.idField, resourceData[i]);
12849
+ index =
12850
+ findIndexInData(lastResource, lastResourceData.idField, resourceData[parseInt(i.toString(), 10)]);
12797
12851
  }
12798
12852
  if (index < 0) {
12799
12853
  return;
12800
12854
  }
12801
- const groupId = lastResource[index][lastResourceData.groupIDField];
12802
- const filter = lastLevel.filter((obj) => obj.resourceData[lastResourceData.idField] === resourceData[i]).
12855
+ const groupId = lastResource[parseInt(index.toString(), 10)][lastResourceData.groupIDField];
12856
+ const filter = lastLevel.filter((obj) => obj.resourceData[lastResourceData.idField] ===
12857
+ resourceData[parseInt(i.toString(), 10)]).
12803
12858
  filter((obj) => obj.resourceData[lastResourceData.groupIDField] === groupId)[0];
12804
12859
  const groupOrder = filter.groupOrder;
12805
12860
  for (let index = 0; index < this.parent.resourceBase.resourceCollection.length; index++) {
12806
- const field = this.parent.resourceBase.resourceCollection[index].field;
12807
- events[field] = (groupOrder[index] instanceof Array) ? groupOrder[index][0] : groupOrder[index];
12861
+ const field = this.parent.resourceBase.resourceCollection[parseInt(index.toString(), 10)].field;
12862
+ events[`${field}`] = (groupOrder[parseInt(index.toString(), 10)] instanceof Array) ? groupOrder[parseInt(index.toString(), 10)][0] :
12863
+ groupOrder[parseInt(index.toString(), 10)];
12808
12864
  }
12809
12865
  addValues();
12810
12866
  }
12811
12867
  else {
12812
12868
  for (let index = 0; index < this.parent.resourceBase.resourceCollection.length - 1; index++) {
12813
- const field = this.parent.resourceBase.resourceCollection[index].field;
12814
- if (events[field] instanceof Array && events[field].length > 1) {
12815
- for (let k = 0; k < events[field].length; k++) {
12869
+ const field = this.parent.resourceBase.resourceCollection[parseInt(index.toString(), 10)].field;
12870
+ if (events[`${field}`] instanceof Array && events[`${field}`].length > 1) {
12871
+ for (let k = 0; k < events[`${field}`].length; k++) {
12816
12872
  const event = extend({}, events, null, true);
12817
- event[field] = eventObj[field][k];
12818
- event[lastResourceData.field] = resourceData[i];
12873
+ event[`${field}`] = eventObj[`${field}`][parseInt(k.toString(), 10)];
12874
+ event[lastResourceData.field] = resourceData[parseInt(i.toString(), 10)];
12819
12875
  temp.push(event);
12820
12876
  }
12821
12877
  }
12822
12878
  else {
12823
12879
  if (temp.length === 0) {
12824
- events[field] = (eventObj[field] instanceof Array) ?
12825
- eventObj[field][0] : eventObj[field];
12826
- events[lastResourceData.field] = resourceData[i];
12880
+ events[`${field}`] = (eventObj[`${field}`] instanceof Array) ?
12881
+ eventObj[`${field}`][0] : eventObj[`${field}`];
12882
+ events[lastResourceData.field] = resourceData[parseInt(i.toString(), 10)];
12827
12883
  }
12828
12884
  else {
12829
12885
  for (let l = 0; l < temp.length; l++) {
12830
- temp[l][field] = (eventObj[field] instanceof Array) ?
12831
- eventObj[field][0] : eventObj[field];
12886
+ temp[parseInt(l.toString(), 10)][`${field}`] = (eventObj[`${field}`] instanceof Array) ?
12887
+ eventObj[`${field}`][0] : eventObj[`${field}`];
12832
12888
  }
12833
12889
  }
12834
12890
  }
12835
12891
  }
12836
- events[lastResourceData.field] = resourceData[i];
12892
+ events[lastResourceData.field] = resourceData[parseInt(i.toString(), 10)];
12837
12893
  addValues();
12838
12894
  }
12839
12895
  }
@@ -13312,21 +13368,24 @@ class VirtualScroll {
13312
13368
  let resCollection = [];
13313
13369
  const index = { startIndex: 0, endIndex: 0 };
13314
13370
  if (this.parent.activeViewOptions.group.byDate) {
13315
- if (lastLevel[startIndex].date.getTime() === this.parent.resourceBase.expandedResources[0].date.getTime() &&
13316
- lastLevel[endIndex].date.getTime() ===
13371
+ if (lastLevel[parseInt(startIndex.toString(), 10)].date.getTime() ===
13372
+ this.parent.resourceBase.expandedResources[0].date.getTime() &&
13373
+ lastLevel[parseInt(endIndex.toString(), 10)].date.getTime() ===
13317
13374
  this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].date.getTime()) {
13318
13375
  return this.parent.resourceBase.expandedResources;
13319
13376
  }
13320
- resCollection = this.getByDateCollection(lastLevel[startIndex], lastLevel[endIndex], index);
13377
+ resCollection =
13378
+ this.getByDateCollection(lastLevel[parseInt(startIndex.toString(), 10)], lastLevel[parseInt(endIndex.toString(), 10)], index);
13321
13379
  this.setRenderedDates(resCollection);
13322
13380
  }
13323
13381
  else {
13324
- if (lastLevel[startIndex].groupIndex === this.parent.resourceBase.expandedResources[0].groupIndex &&
13325
- lastLevel[endIndex].groupIndex ===
13382
+ if (lastLevel[parseInt(startIndex.toString(), 10)].groupIndex === this.parent.resourceBase.expandedResources[0].groupIndex &&
13383
+ lastLevel[parseInt(endIndex.toString(), 10)].groupIndex ===
13326
13384
  this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex) {
13327
13385
  return this.parent.resourceBase.expandedResources;
13328
13386
  }
13329
- resCollection = this.getByIdCollection(lastLevel[startIndex], lastLevel[endIndex], index);
13387
+ resCollection =
13388
+ this.getByIdCollection(lastLevel[parseInt(startIndex.toString(), 10)], lastLevel[parseInt(endIndex.toString(), 10)], index);
13330
13389
  }
13331
13390
  if (this.parent.currentView !== 'Month') {
13332
13391
  this.startIndex = index.startIndex;
@@ -13402,7 +13461,7 @@ class VirtualScroll {
13402
13461
  else {
13403
13462
  const col = [].slice.call(conWrap.querySelector('colgroup').children);
13404
13463
  for (let i = 0; i < col.length; i++) {
13405
- remove(col[i]);
13464
+ remove(col[parseInt(i.toString(), 10)]);
13406
13465
  }
13407
13466
  this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
13408
13467
  const contentRows = this.parent.activeView.getContentRows();
@@ -13492,8 +13551,8 @@ class Render {
13492
13551
  if (this.parent.activeView) {
13493
13552
  const templates = [
13494
13553
  'cellTemplate', 'eventTemplate', 'tooltipTemplate', 'majorSlotTemplate', 'minorSlotTemplate',
13495
- 'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'mothHeaderTemplate',
13496
- 'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate'
13554
+ 'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'monthHeaderTemplate',
13555
+ 'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate', 'dateRangeTemplate'
13497
13556
  ];
13498
13557
  this.parent.resetTemplates(templates);
13499
13558
  this.parent.activeView.removeEventListener();
@@ -13597,7 +13656,7 @@ class Render {
13597
13656
  else if (this.parent.element.classList.contains(READ_ONLY)) {
13598
13657
  removeClass([this.parent.element], READ_ONLY);
13599
13658
  }
13600
- this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());
13659
+ this.parent.headerModule.updateDateRange();
13601
13660
  this.parent.headerModule.updateHeaderItems('remove');
13602
13661
  }
13603
13662
  }
@@ -13766,10 +13825,10 @@ class Crud {
13766
13825
  ['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.parent.currentView) === -1) {
13767
13826
  templateNames = [];
13768
13827
  for (let i = 0, len = this.crudObj.sourceEvent.length; i < len; i++) {
13769
- templateNames.push('eventTemplate_' + this.crudObj.sourceEvent[i].groupIndex);
13770
- if (this.crudObj.targetEvent[i] && this.crudObj.sourceEvent[i].groupIndex !==
13771
- this.crudObj.targetEvent[i].groupIndex) {
13772
- templateNames.push('eventTemplate_' + this.crudObj.targetEvent[i].groupIndex);
13828
+ templateNames.push('eventTemplate_' + this.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex);
13829
+ if (this.crudObj.targetEvent[parseInt(i.toString(), 10)] && this.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
13830
+ this.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
13831
+ templateNames.push('eventTemplate_' + this.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex);
13773
13832
  }
13774
13833
  }
13775
13834
  }
@@ -13809,7 +13868,7 @@ class Crud {
13809
13868
  const groupIndex = this.parent.eventBase.getGroupIndexFromEvent(data);
13810
13869
  if (groupIndex > -1 && this.parent.crudModule.crudObj.sourceEvent.filter((tdData) => tdData.groupIndex === groupIndex).length === 0
13811
13870
  && this.crudObj.isCrudAction) {
13812
- this.crudObj.sourceEvent.push(this.parent.resourceBase.lastResourceLevel[groupIndex]);
13871
+ this.crudObj.sourceEvent.push(this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex.toString(), 10)]);
13813
13872
  }
13814
13873
  }
13815
13874
  this.crudObj.targetEvent = this.crudObj.sourceEvent;
@@ -14013,8 +14072,8 @@ class Crud {
14013
14072
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
14014
14073
  const occurrenceEvents = (occurrenceData instanceof Array ? occurrenceData : [occurrenceData]);
14015
14074
  for (let a = 0, count = occurrenceArgs.changedRecords.length; a < count; a++) {
14016
- const childEvent = occurrenceArgs.changedRecords[a];
14017
- const parentEvent = occurrenceEvents[a].parent;
14075
+ const childEvent = occurrenceArgs.changedRecords[parseInt(a.toString(), 10)];
14076
+ const parentEvent = occurrenceEvents[parseInt(a.toString(), 10)].parent;
14018
14077
  const parentException = parentEvent[fields.recurrenceException];
14019
14078
  let editedData;
14020
14079
  let exceptionDate;
@@ -14080,8 +14139,8 @@ class Crud {
14080
14139
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
14081
14140
  const followEvents = followData instanceof Array ? followData : [followData];
14082
14141
  for (let a = 0, count = followArgs.changedRecords.length; a < count; a++) {
14083
- const childEvent = followArgs.changedRecords[a];
14084
- const parentEvent = followEvents[a].parent;
14142
+ const childEvent = followArgs.changedRecords[parseInt(a.toString(), 10)];
14143
+ const parentEvent = followEvents[parseInt(a.toString(), 10)].parent;
14085
14144
  const followData = this.parent.eventBase.getEventCollections(parentEvent, childEvent);
14086
14145
  let isSpanned;
14087
14146
  switch (action) {
@@ -14150,8 +14209,8 @@ class Crud {
14150
14209
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
14151
14210
  const seriesEvents = seriesData instanceof Array ? seriesData : [seriesData];
14152
14211
  for (let a = 0, count = seriesArgs.changedRecords.length; a < count; a++) {
14153
- const childEvent = seriesArgs.changedRecords[a];
14154
- const parentEvent = seriesEvents[a];
14212
+ const childEvent = seriesArgs.changedRecords[parseInt(a.toString(), 10)];
14213
+ const parentEvent = seriesEvents[parseInt(a.toString(), 10)];
14155
14214
  const eventCollections = this.parent.eventBase.getEventCollections(parentEvent);
14156
14215
  const deletedEvents = eventCollections.follow.concat(eventCollections.occurrence);
14157
14216
  switch (action) {
@@ -14209,11 +14268,11 @@ class Crud {
14209
14268
  const fields = this.parent.eventFields;
14210
14269
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
14211
14270
  for (let a = 0, count = deleteArgs.deletedRecords.length; a < count; a++) {
14212
- let isDelete = isNullOrUndefined(deleteArgs.deletedRecords[a][this.parent.eventFields.recurrenceRule]);
14271
+ let isDelete = isNullOrUndefined(deleteArgs.deletedRecords[parseInt(a.toString(), 10)][this.parent.eventFields.recurrenceRule]);
14213
14272
  if (!isDelete) {
14214
- const parentEvent = deleteData[a].parent;
14273
+ const parentEvent = deleteData[parseInt(a.toString(), 10)].parent;
14215
14274
  const isEdited = editParams.changedRecords.filter((obj) => obj[fields.id] === parentEvent[fields.id]);
14216
- const editedDate = deleteArgs.deletedRecords[a][fields.startTime];
14275
+ const editedDate = deleteArgs.deletedRecords[parseInt(a.toString(), 10)][fields.startTime];
14217
14276
  if (isEdited.length > 0) {
14218
14277
  const editedData = isEdited[0];
14219
14278
  editedData[fields.recurrenceException] =
@@ -14226,10 +14285,10 @@ class Crud {
14226
14285
  if (isEdited.length === 0) {
14227
14286
  editParams.changedRecords.push(this.parent.eventBase.processTimezone(parentEvent, true));
14228
14287
  }
14229
- isDelete = deleteArgs.deletedRecords[a][fields.id] !== parentEvent[fields.id];
14288
+ isDelete = deleteArgs.deletedRecords[parseInt(a.toString(), 10)][fields.id] !== parentEvent[fields.id];
14230
14289
  }
14231
14290
  if (isDelete) {
14232
- editParams.deletedRecords.push(deleteArgs.deletedRecords[a]);
14291
+ editParams.deletedRecords.push(deleteArgs.deletedRecords[parseInt(a.toString(), 10)]);
14233
14292
  }
14234
14293
  }
14235
14294
  const promise = this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, this.getTable(), this.getQuery());
@@ -14669,6 +14728,9 @@ __decorate$9([
14669
14728
  __decorate$9([
14670
14729
  Property()
14671
14730
  ], Group.prototype, "headerTooltipTemplate", void 0);
14731
+ __decorate$9([
14732
+ Property(false)
14733
+ ], Group.prototype, "hideNonWorkingDays", void 0);
14672
14734
 
14673
14735
  var __decorate$10 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14674
14736
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -14734,6 +14796,7 @@ class ResourceBase {
14734
14796
  constructor(parent) {
14735
14797
  this.resourceCollection = [];
14736
14798
  this.leftPixel = 25;
14799
+ this.resourceDateTree = [];
14737
14800
  this.parent = parent;
14738
14801
  }
14739
14802
  renderResourceHeaderIndent(tr) {
@@ -14756,8 +14819,8 @@ class ResourceBase {
14756
14819
  }
14757
14820
  const trCount = this.lastResourceLevel.length;
14758
14821
  for (let i = 0; i < trCount; i++) {
14759
- const resData = this.lastResourceLevel[i].resourceData;
14760
- const res = this.lastResourceLevel[i].resource;
14822
+ const resData = this.lastResourceLevel[parseInt(i.toString(), 10)].resourceData;
14823
+ const res = this.lastResourceLevel[parseInt(i.toString(), 10)].resource;
14761
14824
  if (resData.ClassName === RESOURCE_PARENT_CLASS && !resData[res.expandedField] &&
14762
14825
  !isNullOrUndefined(resData[res.expandedField])) {
14763
14826
  const trCollection = [].slice.call(tBody.children);
@@ -14800,10 +14863,10 @@ class ResourceBase {
14800
14863
  setExpandedResources() {
14801
14864
  const resources = [];
14802
14865
  for (let i = 0; i < this.lastResourceLevel.length; i++) {
14803
- const resource = this.lastResourceLevel[i].resourceData;
14866
+ const resource = this.lastResourceLevel[parseInt(i.toString(), 10)].resourceData;
14804
14867
  const count = resource.Count;
14805
- resources.push(this.lastResourceLevel[i]);
14806
- const isExpanded = resource[this.lastResourceLevel[i].resource.expandedField];
14868
+ resources.push(this.lastResourceLevel[parseInt(i.toString(), 10)]);
14869
+ const isExpanded = resource[this.lastResourceLevel[parseInt(i.toString(), 10)].resource.expandedField];
14807
14870
  if (!isNullOrUndefined(isExpanded) && !isExpanded && count > 0) {
14808
14871
  i = i + count;
14809
14872
  }
@@ -14819,21 +14882,21 @@ class ResourceBase {
14819
14882
  const td = createElement('td', { attrs: { tabindex: isVirtualScroll ? '-1' : '0' } });
14820
14883
  for (let i = 0; i < resData.length; i++) {
14821
14884
  const ntd = td.cloneNode();
14822
- rIndex = findIndexInData(resColl, 'name', resData[i].resource.name);
14885
+ rIndex = findIndexInData(resColl, 'name', resData[parseInt(i.toString(), 10)].resource.name);
14823
14886
  if (rIndex === resColl.length - 1) {
14824
- extend(resData[i].resourceData, { ClassName: RESOURCE_CHILD_CLASS });
14825
- this.renderedResources[i].className = [RESOURCE_CHILD_CLASS];
14887
+ extend(resData[parseInt(i.toString(), 10)].resourceData, { ClassName: RESOURCE_CHILD_CLASS });
14888
+ this.renderedResources[parseInt(i.toString(), 10)].className = [RESOURCE_CHILD_CLASS];
14826
14889
  }
14827
14890
  else {
14828
- extend(resData[i].resourceData, { ClassName: RESOURCE_PARENT_CLASS });
14829
- this.renderedResources[i].className = [RESOURCE_PARENT_CLASS];
14891
+ extend(resData[parseInt(i.toString(), 10)].resourceData, { ClassName: RESOURCE_PARENT_CLASS });
14892
+ this.renderedResources[parseInt(i.toString(), 10)].className = [RESOURCE_PARENT_CLASS];
14830
14893
  }
14831
14894
  left = (rIndex * this.leftPixel) + 'px';
14832
- if (resData[i].resourceData.ClassName === RESOURCE_PARENT_CLASS
14833
- && !isNullOrUndefined(resData[i].resourceData.Count) && (resData[i].resourceData.Count > 0)) {
14895
+ if (resData[parseInt(i.toString(), 10)].resourceData.ClassName === RESOURCE_PARENT_CLASS
14896
+ && !isNullOrUndefined(resData[parseInt(i.toString(), 10)].resourceData.Count) && (resData[parseInt(i.toString(), 10)].resourceData.Count > 0)) {
14834
14897
  let iconClass;
14835
- if (resData[i].resourceData[resColl[rIndex].expandedField] ||
14836
- isNullOrUndefined(resData[i].resourceData[resColl[rIndex].expandedField])) {
14898
+ if (resData[parseInt(i.toString(), 10)].resourceData[resColl[parseInt(rIndex.toString(), 10)].expandedField] ||
14899
+ isNullOrUndefined(resData[parseInt(i.toString(), 10)].resourceData[resColl[parseInt(rIndex.toString(), 10)].expandedField])) {
14837
14900
  iconClass = RESOURCE_COLLAPSE_CLASS;
14838
14901
  }
14839
14902
  else {
@@ -14847,15 +14910,15 @@ class ResourceBase {
14847
14910
  EventHandler.add(iconDiv, 'click', this.onTreeIconClick, this);
14848
14911
  }
14849
14912
  }
14850
- this.parent.activeView.setResourceHeaderContent(ntd, resData[i], RESOURCE_TEXT_CLASS);
14851
- ntd.setAttribute('data-group-index', resData[i].groupIndex.toString());
14852
- ntd.setAttribute('aria-label', resData[i].resourceData[resData[i].resource.textField] + ' resource');
14913
+ this.parent.activeView.setResourceHeaderContent(ntd, resData[parseInt(i.toString(), 10)], RESOURCE_TEXT_CLASS);
14914
+ ntd.setAttribute('data-group-index', resData[parseInt(i.toString(), 10)].groupIndex.toString());
14915
+ ntd.setAttribute('aria-label', resData[parseInt(i.toString(), 10)].resourceData[resData[parseInt(i.toString(), 10)].resource.textField] + ' resource');
14853
14916
  if (!this.parent.activeViewOptions.resourceHeaderTemplate) {
14854
14917
  this.setMargin(ntd.querySelector('.' + RESOURCE_TEXT_CLASS), left);
14855
14918
  }
14856
- const classCollection = [RESOURCE_CELLS_CLASS, resData[i].resourceData.ClassName];
14919
+ const classCollection = [RESOURCE_CELLS_CLASS, resData[parseInt(i.toString(), 10)].resourceData.ClassName];
14857
14920
  addClass([ntd], classCollection);
14858
- const args = { elementType: 'resourceHeader', element: ntd, groupIndex: resData[i].groupIndex };
14921
+ const args = { elementType: 'resourceHeader', element: ntd, groupIndex: resData[parseInt(i.toString(), 10)].groupIndex };
14859
14922
  this.parent.trigger(renderCell, args);
14860
14923
  const ntr = tr.cloneNode();
14861
14924
  ntr.appendChild(ntd);
@@ -14878,17 +14941,17 @@ class ResourceBase {
14878
14941
  for (let x = 0; x < data.length; x++) {
14879
14942
  let totalCount = 0;
14880
14943
  if (this.parent.activeViewOptions.group.byGroupID) {
14881
- const query = new Query().where(wholeCollection[wholeCollection.length - 1].groupIDField, 'equal', data[x][parentCollection[parentCollection.length - (y + 1)].idField]);
14944
+ const query = new Query().where(wholeCollection[wholeCollection.length - 1].groupIDField, 'equal', data[parseInt(x.toString(), 10)][parentCollection[parentCollection.length - (y + 1)].idField]);
14882
14945
  collection = new DataManager(wholeCollection[wholeCollection.length - 1].dataSource).executeLocal(query);
14883
14946
  }
14884
14947
  else {
14885
14948
  collection = wholeCollection[wholeCollection.length - 1].dataSource;
14886
14949
  }
14887
14950
  for (let z = 0; z < collection.length; z++) {
14888
- totalCount = totalCount + parseInt(collection[z].Count, 10);
14951
+ totalCount = totalCount + parseInt(collection[parseInt(z.toString(), 10)].Count, 10);
14889
14952
  }
14890
- totalCount = totalCount + parseInt(data[x].Count, 10);
14891
- extend(data[x], { Count: totalCount });
14953
+ totalCount = totalCount + parseInt(data[parseInt(x.toString(), 10)].Count, 10);
14954
+ extend(data[parseInt(x.toString(), 10)], { Count: totalCount });
14892
14955
  }
14893
14956
  wholeCollection = wholeCollection.slice(0, -1);
14894
14957
  }
@@ -14942,7 +15005,7 @@ class ResourceBase {
14942
15005
  const workCellCollection = [];
14943
15006
  const headerRowCollection = [];
14944
15007
  let pNode;
14945
- const clickedRes = this.lastResourceLevel[index].resourceData;
15008
+ const clickedRes = this.lastResourceLevel[parseInt(index.toString(), 10)].resourceData;
14946
15009
  const resRows = [].slice.call(this.parent.element.querySelectorAll('.' + RESOURCE_COLUMN_WRAP_CLASS + ' ' + 'tr'));
14947
15010
  const contentRows = [].slice.call(this.parent.element.querySelectorAll('.' + CONTENT_WRAP_CLASS + ' ' + 'tbody tr'));
14948
15011
  const eventRows = [].slice.call(this.parent.element.querySelectorAll('.' + CONTENT_WRAP_CLASS + ' .' + APPOINTMENT_CONTAINER_CLASS));
@@ -14954,45 +15017,45 @@ class ResourceBase {
14954
15017
  const clonedCollection = this.lastResourceLevel;
14955
15018
  for (let i = 0; i < rowCollection.length; i++) {
14956
15019
  let expanded = true;
14957
- pNode = rowCollection[i].children[0].classList.contains(RESOURCE_PARENT_CLASS);
14958
- clonedCollection[index].resourceData[clonedCollection[index].resource.expandedField] = !hide;
15020
+ pNode = rowCollection[parseInt(i.toString(), 10)].children[0].classList.contains(RESOURCE_PARENT_CLASS);
15021
+ clonedCollection[parseInt(index.toString(), 10)].resourceData[clonedCollection[parseInt(index.toString(), 10)].resource.expandedField] = !hide;
14959
15022
  if (hide) {
14960
15023
  if (pNode) {
14961
- const trElem = rowCollection[i].querySelector('.' + RESOURCE_TREE_ICON_CLASS);
15024
+ const trElem = rowCollection[parseInt(i.toString(), 10)].querySelector('.' + RESOURCE_TREE_ICON_CLASS);
14962
15025
  if (trElem) {
14963
15026
  classList(trElem, [RESOURCE_EXPAND_CLASS], [RESOURCE_COLLAPSE_CLASS]);
14964
15027
  }
14965
15028
  }
14966
- if (!rowCollection[i].classList.contains(HIDDEN_CLASS)) {
14967
- addClass([rowCollection[i], workCellCollection[i], headerRowCollection[i]], HIDDEN_CLASS);
15029
+ if (!rowCollection[parseInt(i.toString(), 10)].classList.contains(HIDDEN_CLASS)) {
15030
+ addClass([rowCollection[parseInt(i.toString(), 10)], workCellCollection[parseInt(i.toString(), 10)], headerRowCollection[parseInt(i.toString(), 10)]], HIDDEN_CLASS);
14968
15031
  }
14969
15032
  }
14970
15033
  else {
14971
15034
  if (pNode) {
14972
- const rowIndex = rowCollection[i].rowIndex;
14973
- if (!clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField]
14974
- && !isNullOrUndefined(clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField])) {
14975
- rowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));
14976
- workCellCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));
14977
- headerRowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 10)));
15035
+ const rowIndex = rowCollection[parseInt(i.toString(), 10)].rowIndex;
15036
+ if (!clonedCollection[parseInt(rowIndex.toString(), 10)].resourceData[clonedCollection[parseInt(rowIndex.toString(), 10)].resource.expandedField]
15037
+ && !isNullOrUndefined(clonedCollection[parseInt(rowIndex.toString(), 10)].resourceData[clonedCollection[parseInt(rowIndex.toString(), 10)].resource.expandedField])) {
15038
+ rowCollection.splice(i + 1, (parseInt(clonedCollection[parseInt(rowIndex.toString(), 10)].resourceData.Count, 10)));
15039
+ workCellCollection.splice(i + 1, (parseInt(clonedCollection[parseInt(rowIndex.toString(), 10)].resourceData.Count, 10)));
15040
+ headerRowCollection.splice(i + 1, (parseInt(clonedCollection[parseInt(rowIndex.toString(), 10)].resourceData.Count, 10)));
14978
15041
  expanded = false;
14979
15042
  }
14980
15043
  if (expanded) {
14981
- const trElem = rowCollection[i].querySelector('.' + RESOURCE_TREE_ICON_CLASS);
15044
+ const trElem = rowCollection[parseInt(i.toString(), 10)].querySelector('.' + RESOURCE_TREE_ICON_CLASS);
14982
15045
  if (trElem) {
14983
15046
  classList(trElem, [RESOURCE_COLLAPSE_CLASS], [RESOURCE_EXPAND_CLASS]);
14984
15047
  }
14985
15048
  }
14986
15049
  }
14987
- if (rowCollection[i].classList.contains(HIDDEN_CLASS)) {
14988
- removeClass([rowCollection[i], workCellCollection[i], headerRowCollection[i]], HIDDEN_CLASS);
15050
+ if (rowCollection[parseInt(i.toString(), 10)].classList.contains(HIDDEN_CLASS)) {
15051
+ removeClass([rowCollection[parseInt(i.toString(), 10)], workCellCollection[parseInt(i.toString(), 10)], headerRowCollection[parseInt(i.toString(), 10)]], HIDDEN_CLASS);
14989
15052
  }
14990
15053
  }
14991
15054
  }
14992
15055
  }
14993
15056
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
14994
15057
  updateVirtualContent(index, expand, e, target) {
14995
- this.lastResourceLevel[index].resourceData[this.lastResourceLevel[index].resource.expandedField] = !expand;
15058
+ this.lastResourceLevel[parseInt(index.toString(), 10)].resourceData[this.lastResourceLevel[parseInt(index.toString(), 10)].resource.expandedField] = !expand;
14996
15059
  this.setExpandedResources();
14997
15060
  const resourceCount = this.parent.virtualScrollModule.getRenderedCount();
14998
15061
  const startIndex = this.expandedResources.indexOf(this.renderedResources[0]);
@@ -15082,7 +15145,7 @@ class ResourceBase {
15082
15145
  let groupIndex = 0;
15083
15146
  for (let i = 0, len = this.resourceTreeLevel.length; i < len; i++) {
15084
15147
  const treeHandler = (treeLevel, index, levelId) => {
15085
- const resource = this.resourceCollection[index];
15148
+ const resource = this.resourceCollection[parseInt(index.toString(), 10)];
15086
15149
  let treeArgs;
15087
15150
  let resObj;
15088
15151
  if (!isTimeLine) {
@@ -15121,10 +15184,10 @@ class ResourceBase {
15121
15184
  return treeArgs;
15122
15185
  };
15123
15186
  if (!isTimeLine) {
15124
- treeCollection.push(treeHandler(this.resourceTreeLevel[i], 0, (i + 1).toString()));
15187
+ treeCollection.push(treeHandler(this.resourceTreeLevel[parseInt(i.toString(), 10)], 0, (i + 1).toString()));
15125
15188
  }
15126
15189
  else {
15127
- treeHandler(this.resourceTreeLevel[i], 0, (i + 1).toString());
15190
+ treeHandler(this.resourceTreeLevel[parseInt(i.toString(), 10)], 0, (i + 1).toString());
15128
15191
  }
15129
15192
  }
15130
15193
  if (isTimeLine) {
@@ -15139,8 +15202,8 @@ class ResourceBase {
15139
15202
  const resource = this.lastResourceLevel[this.parent.uiStateValues.groupIndex];
15140
15203
  const headerCollection = [];
15141
15204
  for (let i = 0, len = resource.groupOrder.length; i < len; i++) {
15142
- const resourceLevel = this.resourceCollection[i];
15143
- const resourceText = resourceLevel.dataSource.filter((resData) => resData[resourceLevel.idField] === resource.groupOrder[i]);
15205
+ const resourceLevel = this.resourceCollection[parseInt(i.toString(), 10)];
15206
+ const resourceText = resourceLevel.dataSource.filter((resData) => resData[resourceLevel.idField] === resource.groupOrder[parseInt(i.toString(), 10)]);
15144
15207
  const resourceName = createElement('div', {
15145
15208
  className: RESOURCE_NAME,
15146
15209
  innerHTML: resourceText[0][resourceLevel.textField]
@@ -15228,8 +15291,8 @@ class ResourceBase {
15228
15291
  }
15229
15292
  this.parent.resourceCollection = [];
15230
15293
  for (let i = 0, length = e.length; i < length; i++) {
15231
- const resource = this.parent.resources[i];
15232
- const resourceObj = this.getResourceModel(resource, e[i].result);
15294
+ const resource = this.parent.resources[parseInt(i.toString(), 10)];
15295
+ const resourceObj = this.getResourceModel(resource, e[parseInt(i.toString(), 10)].result);
15233
15296
  this.parent.resourceCollection.push(resourceObj);
15234
15297
  }
15235
15298
  this.refreshLayout(isSetModel);
@@ -15267,7 +15330,7 @@ class ResourceBase {
15267
15330
  for (const resource of this.parent.activeViewOptions.group.resources) {
15268
15331
  const index = findIndexInData(this.parent.resourceCollection, 'name', resource);
15269
15332
  if (index >= 0) {
15270
- requiredResources.push(this.parent.resourceCollection[index]);
15333
+ requiredResources.push(this.parent.resourceCollection[parseInt(index.toString(), 10)]);
15271
15334
  }
15272
15335
  }
15273
15336
  }
@@ -15308,8 +15371,8 @@ class ResourceBase {
15308
15371
  if (prevOrder && prevOrder.length > 0) {
15309
15372
  groupOrder = groupOrder.concat(prevOrder);
15310
15373
  }
15311
- groupOrder.push(data[i][resource.idField]);
15312
- const items = group(resources.slice(1), index + 1, resource, data[i], groupOrder);
15374
+ groupOrder.push(data[parseInt(i.toString(), 10)][resource.idField]);
15375
+ const items = group(resources.slice(1), index + 1, resource, data[parseInt(i.toString(), 10)], groupOrder);
15313
15376
  // Here validate child item empty top level resource only
15314
15377
  if (index === 0 && items.length === 0 && this.resourceCollection.length > 1) {
15315
15378
  continue;
@@ -15318,9 +15381,9 @@ class ResourceBase {
15318
15381
  let renderDates = this.parent.activeView.renderDates;
15319
15382
  let resWorkDays;
15320
15383
  if (!this.parent.activeViewOptions.group.byDate && index + 1 === this.resourceCollection.length) {
15321
- const workDays = data[i][resource.workDaysField];
15322
- const resStartHour = data[i][resource.startHourField];
15323
- const resEndHour = data[i][resource.endHourField];
15384
+ const workDays = data[parseInt(i.toString(), 10)][resource.workDaysField];
15385
+ const resStartHour = data[parseInt(i.toString(), 10)][resource.startHourField];
15386
+ const resEndHour = data[parseInt(i.toString(), 10)][resource.endHourField];
15324
15387
  if (workDays && workDays.length > 0) {
15325
15388
  renderDates = this.parent.activeView.getRenderDates(workDays);
15326
15389
  resWorkDays = workDays;
@@ -15333,22 +15396,22 @@ class ResourceBase {
15333
15396
  const dateSlots = this.generateCustomHours(dateCol, resStartHour, resEndHour, groupOrder);
15334
15397
  lastColumnDates = lastColumnDates.concat(dateSlots);
15335
15398
  }
15336
- const resCssClass = data[i][resource.cssClassField];
15399
+ const resCssClass = data[parseInt(i.toString(), 10)][resource.cssClassField];
15337
15400
  const slotData = {
15338
15401
  type: 'resourceHeader', className: ['e-resource-cells'],
15339
15402
  resourceLevelIndex: index, groupOrder: groupOrder,
15340
- resource: resource, resourceData: data[i],
15403
+ resource: resource, resourceData: data[parseInt(i.toString(), 10)],
15341
15404
  colSpan: this.parent.activeViewOptions.group.byDate ? 1 : dateCol.length,
15342
15405
  renderDates: renderDates, workDays: resWorkDays, cssClass: resCssClass,
15343
15406
  child: items
15344
15407
  };
15345
15408
  resTree.push(slotData);
15346
15409
  }
15347
- if (!resTreeGroup[index]) {
15348
- resTreeGroup[index] = [];
15410
+ if (!resTreeGroup[parseInt(index.toString(), 10)]) {
15411
+ resTreeGroup[parseInt(index.toString(), 10)] = [];
15349
15412
  }
15350
15413
  if (resTree.length > 0) {
15351
- resTreeGroup[index].push(resTree);
15414
+ resTreeGroup[parseInt(index.toString(), 10)].push(resTree);
15352
15415
  }
15353
15416
  return resTree;
15354
15417
  }
@@ -15376,10 +15439,10 @@ class ResourceBase {
15376
15439
  const headerLevels = [];
15377
15440
  for (let i = resTreeGroup.length - 1; i >= 0; i--) {
15378
15441
  let temp = 0;
15379
- for (const currentLevelChilds of resTreeGroup[i]) {
15442
+ for (const currentLevelChilds of resTreeGroup[parseInt(i.toString(), 10)]) {
15380
15443
  for (const currentLevelChild of currentLevelChilds) {
15381
15444
  if (resTreeGroup[i + 1] && resTreeGroup[i + 1].length > 0) {
15382
- const nextLevelChilds = resTreeGroup[i + 1][temp];
15445
+ const nextLevelChilds = resTreeGroup[parseInt((i + 1).toString(), 10)][parseInt(temp.toString(), 10)];
15383
15446
  if (!nextLevelChilds) {
15384
15447
  continue;
15385
15448
  }
@@ -15405,7 +15468,7 @@ class ResourceBase {
15405
15468
  let index = 0;
15406
15469
  for (const lastLevelResource of this.lastResourceLevel) {
15407
15470
  for (let i = 0; i < lastLevelResource.colSpan; i++) {
15408
- lastColumnDates[index].groupIndex = lastLevelResource.groupIndex;
15471
+ lastColumnDates[parseInt(index.toString(), 10)].groupIndex = lastLevelResource.groupIndex;
15409
15472
  index++;
15410
15473
  }
15411
15474
  }
@@ -15414,18 +15477,88 @@ class ResourceBase {
15414
15477
  }
15415
15478
  const dateHeaderLevels = [];
15416
15479
  const levels = extend([], headerLevels, null, true);
15480
+ const datesColumn = [];
15481
+ if (this.parent.activeViewOptions.group.hideNonWorkingDays) {
15482
+ const renderDates = [];
15483
+ let dateIndex = 0;
15484
+ for (const headerDate of headerDates) {
15485
+ this.resourceDateTree[parseInt(dateIndex.toString(), 10)] = [];
15486
+ const currentDateLevels = [];
15487
+ for (let j = 0; j < this.lastResourceLevel.length; j++) {
15488
+ let workDays = this.lastResourceLevel[parseInt(j.toString(), 10)].resourceData[this.lastResourceLevel[parseInt(j.toString(), 10)].resource.workDaysField];
15489
+ if (!workDays) {
15490
+ workDays = this.parent.activeViewOptions.workDays;
15491
+ }
15492
+ if (workDays.indexOf(headerDate.date.getDay()) !== -1) {
15493
+ const resTd = extend({}, this.lastResourceLevel[parseInt(j.toString(), 10)], null, true);
15494
+ resTd.date = headerDate.date;
15495
+ this.lastResourceLevel[parseInt(j.toString(), 10)].workDays = workDays;
15496
+ resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||
15497
+ headerDate.startHour;
15498
+ resTd.endHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.endHourField]) ||
15499
+ headerDate.endHour;
15500
+ this.resourceDateTree[parseInt(dateIndex.toString(), 10)].push(resTd);
15501
+ for (let k = 0; k < resTd.groupOrder.length; k++) {
15502
+ if (!currentDateLevels[parseInt(k.toString(), 10)]) {
15503
+ currentDateLevels[parseInt(k.toString(), 10)] = [];
15504
+ }
15505
+ if (k === resTd.groupOrder.length - 1) {
15506
+ if (!renderDates[parseInt(j.toString(), 10)]) {
15507
+ renderDates[parseInt(j.toString(), 10)] = [];
15508
+ }
15509
+ const filterDates = resTd.renderDates.filter((x) => x.getDay() === headerDate.date.getDay());
15510
+ renderDates[parseInt(j.toString(), 10)] = renderDates[parseInt(j.toString(), 10)].concat(filterDates);
15511
+ currentDateLevels[parseInt(k.toString(), 10)].push(resTd);
15512
+ continue;
15513
+ }
15514
+ const currentLevel = levels[parseInt(k.toString(), 10)];
15515
+ const filteredResource = currentLevel.filter((data) => data.resourceData[data.resource.idField] === resTd.groupOrder[parseInt(k.toString(), 10)]);
15516
+ if (filteredResource && filteredResource.length > 0) {
15517
+ const existedResource = currentDateLevels[parseInt(k.toString(), 10)].filter((data) => data.resourceData[data.resource.idField] === resTd.groupOrder[parseInt(k.toString(), 10)]);
15518
+ if (existedResource && existedResource.length > 0) {
15519
+ existedResource[0].colSpan += 1;
15520
+ }
15521
+ else {
15522
+ const filteredTd = extend({}, filteredResource[0], null, true);
15523
+ filteredTd.colSpan = 1;
15524
+ currentDateLevels[parseInt(k.toString(), 10)].push(filteredTd);
15525
+ }
15526
+ }
15527
+ }
15528
+ }
15529
+ }
15530
+ if (currentDateLevels.length > 0) {
15531
+ for (let l = 0; l < levels.length; l++) {
15532
+ if (!dateHeaderLevels[parseInt(l.toString(), 10)]) {
15533
+ dateHeaderLevels[parseInt(l.toString(), 10)] = [];
15534
+ }
15535
+ dateHeaderLevels[parseInt(l.toString(), 10)] = dateHeaderLevels[parseInt(l.toString(), 10)].concat(currentDateLevels[parseInt(l.toString(), 10)]);
15536
+ }
15537
+ headerDate.colSpan = currentDateLevels[currentDateLevels.length - 1].length;
15538
+ datesColumn.push(headerDate);
15539
+ }
15540
+ dateIndex++;
15541
+ }
15542
+ this.resourceDateTree = this.resourceDateTree.filter((data) => data.length > 0);
15543
+ this.lastResourceLevel.forEach((x, index) => {
15544
+ if (renderDates[parseInt(index.toString(), 10)]) {
15545
+ x.renderDates = renderDates[parseInt(index.toString(), 10)].sort((a, b) => a.getTime() - b.getTime());
15546
+ }
15547
+ });
15548
+ dateHeaderLevels.unshift(datesColumn);
15549
+ return dateHeaderLevels;
15550
+ }
15417
15551
  let dateColSpan = 0;
15418
15552
  for (const firstRowTd of levels[0]) {
15419
15553
  dateColSpan += firstRowTd.colSpan;
15420
15554
  }
15421
- const datesColumn = [];
15422
15555
  for (const headerDate of headerDates) {
15423
15556
  headerDate.colSpan = dateColSpan;
15424
15557
  datesColumn.push(headerDate);
15425
15558
  const resGroup = extend([], levels, null, true);
15426
15559
  for (let k = 0, length = resGroup.length; k < length; k++) {
15427
15560
  if (k === resGroup.length - 1) {
15428
- for (const resTd of resGroup[k]) {
15561
+ for (const resTd of resGroup[parseInt(k.toString(), 10)]) {
15429
15562
  resTd.date = headerDate.date;
15430
15563
  resTd.workDays = headerDate.workDays;
15431
15564
  resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||
@@ -15434,10 +15567,10 @@ class ResourceBase {
15434
15567
  headerDate.endHour;
15435
15568
  }
15436
15569
  }
15437
- if (!dateHeaderLevels[k]) {
15438
- dateHeaderLevels[k] = [];
15570
+ if (!dateHeaderLevels[parseInt(k.toString(), 10)]) {
15571
+ dateHeaderLevels[parseInt(k.toString(), 10)] = [];
15439
15572
  }
15440
- dateHeaderLevels[k] = dateHeaderLevels[k].concat(resGroup[k]);
15573
+ dateHeaderLevels[parseInt(k.toString(), 10)] = dateHeaderLevels[parseInt(k.toString(), 10)].concat(resGroup[parseInt(k.toString(), 10)]);
15441
15574
  }
15442
15575
  }
15443
15576
  dateHeaderLevels.unshift(datesColumn);
@@ -15445,11 +15578,11 @@ class ResourceBase {
15445
15578
  }
15446
15579
  setResourceValues(eventObj, groupIndex) {
15447
15580
  const setValues = (index, field, value) => {
15448
- if (this.resourceCollection[index].allowMultiple && this.parent.activeViewOptions.group.allowGroupEdit) {
15449
- eventObj[field] = [value];
15581
+ if (this.resourceCollection[parseInt(index.toString(), 10)].allowMultiple && this.parent.activeViewOptions.group.allowGroupEdit) {
15582
+ eventObj[`${field}`] = [value];
15450
15583
  }
15451
15584
  else {
15452
- eventObj[field] = value;
15585
+ eventObj[`${field}`] = value;
15453
15586
  }
15454
15587
  };
15455
15588
  if (groupIndex === void 0) {
@@ -15457,16 +15590,16 @@ class ResourceBase {
15457
15590
  this.parent.activeCellsData.groupIndex;
15458
15591
  }
15459
15592
  if (this.parent.activeViewOptions.group.resources.length > 0 && !isNullOrUndefined(groupIndex)) {
15460
- const groupOrder = this.lastResourceLevel[groupIndex].groupOrder;
15593
+ const groupOrder = this.lastResourceLevel[parseInt(groupIndex.toString(), 10)].groupOrder;
15461
15594
  for (let index = 0; index < this.resourceCollection.length; index++) {
15462
- setValues(index, this.resourceCollection[index].field, groupOrder[index]);
15595
+ setValues(index, this.resourceCollection[parseInt(index.toString(), 10)].field, groupOrder[parseInt(index.toString(), 10)]);
15463
15596
  }
15464
15597
  }
15465
15598
  else if (this.parent.resourceCollection.length > 0) {
15466
15599
  for (let index = 0; index < this.resourceCollection.length; index++) {
15467
- const data = this.resourceCollection[index].dataSource[0];
15600
+ const data = this.resourceCollection[parseInt(index.toString(), 10)].dataSource[0];
15468
15601
  if (data) {
15469
- setValues(index, this.resourceCollection[index].field, data[this.resourceCollection[index].idField]);
15602
+ setValues(index, this.resourceCollection[parseInt(index.toString(), 10)].field, data[this.resourceCollection[parseInt(index.toString(), 10)].idField]);
15470
15603
  }
15471
15604
  }
15472
15605
  }
@@ -15474,11 +15607,11 @@ class ResourceBase {
15474
15607
  getResourceColor(eventObj, groupOrder) {
15475
15608
  const colorFieldIndex = (!isNullOrUndefined(groupOrder) &&
15476
15609
  this.colorIndex > groupOrder.length - 1) ? groupOrder.length - 1 : this.colorIndex;
15477
- const resource = this.resourceCollection[colorFieldIndex];
15610
+ const resource = this.resourceCollection[parseInt(colorFieldIndex.toString(), 10)];
15478
15611
  if (isNullOrUndefined(groupOrder) && this.parent.activeViewOptions.group.allowGroupEdit && resource.allowMultiple) {
15479
15612
  return undefined;
15480
15613
  }
15481
- const id = isNullOrUndefined(groupOrder) ? eventObj[resource.field] : groupOrder[colorFieldIndex];
15614
+ const id = isNullOrUndefined(groupOrder) ? eventObj[resource.field] : groupOrder[parseInt(colorFieldIndex.toString(), 10)];
15482
15615
  const data = this.filterData(resource.dataSource, resource.idField, id);
15483
15616
  if (data.length > 0) {
15484
15617
  return data[0][resource.colorField];
@@ -15505,27 +15638,27 @@ class ResourceBase {
15505
15638
  return renderDates;
15506
15639
  }
15507
15640
  filterData(dataSource, field, value) {
15508
- return dataSource.filter((data) => data[field] === value);
15641
+ return dataSource.filter((data) => data[`${field}`] === value);
15509
15642
  }
15510
15643
  getResourceData(eventObj, index, groupEditIndex) {
15511
15644
  if (this.parent.activeViewOptions.group.allowGroupEdit) {
15512
15645
  const resourceObj = {};
15513
15646
  for (const groupIndex of groupEditIndex) {
15514
- const resourceLevel = this.lastResourceLevel[groupIndex].groupOrder;
15647
+ const resourceLevel = this.lastResourceLevel[parseInt(groupIndex.toString(), 10)].groupOrder;
15515
15648
  for (let level = 0, length = resourceLevel.length; level < length; level++) {
15516
- const fieldName = this.resourceCollection[level].field;
15517
- if (isNullOrUndefined(resourceObj[fieldName])) {
15518
- resourceObj[fieldName] = [];
15649
+ const fieldName = this.resourceCollection[parseInt(level.toString(), 10)].field;
15650
+ if (isNullOrUndefined(resourceObj[`${fieldName}`])) {
15651
+ resourceObj[`${fieldName}`] = [];
15519
15652
  }
15520
- resourceObj[fieldName].push(resourceLevel[level]);
15653
+ resourceObj[`${fieldName}`].push(resourceLevel[parseInt(level.toString(), 10)]);
15521
15654
  }
15522
15655
  }
15523
15656
  eventObj = extend(eventObj, resourceObj);
15524
15657
  }
15525
15658
  else {
15526
15659
  for (let level = 0, length = this.resourceCollection.length; level < length; level++) {
15527
- if (this.lastResourceLevel[index]) {
15528
- eventObj[this.resourceCollection[level].field] = this.lastResourceLevel[index].groupOrder[level];
15660
+ if (this.lastResourceLevel[parseInt(index.toString(), 10)]) {
15661
+ eventObj[this.resourceCollection[parseInt(level.toString(), 10)].field] = this.lastResourceLevel[parseInt(index.toString(), 10)].groupOrder[parseInt(level.toString(), 10)];
15529
15662
  }
15530
15663
  }
15531
15664
  }
@@ -15560,7 +15693,7 @@ class ResourceBase {
15560
15693
  }
15561
15694
  const resource = resourceData.dataSource.filter((e) => {
15562
15695
  if (event && e[resourceData.idField] === id) {
15563
- if (e[resourceData.groupIDField] === event[parentField]) {
15696
+ if (e[resourceData.groupIDField] === event[`${parentField}`]) {
15564
15697
  return e[resourceData.idField] === id;
15565
15698
  }
15566
15699
  return null;
@@ -15661,7 +15794,7 @@ class ResourceBase {
15661
15794
  }
15662
15795
  const offsetTarget = this.parent.element.querySelector(`.${HEADER_ROW_CLASS}:nth-child(${levelIndex + 1})`);
15663
15796
  const offset = [].slice.call(offsetTarget.children).map((node) => node.offsetLeft);
15664
- scrollElement.scrollLeft = offset[index];
15797
+ scrollElement.scrollLeft = offset[parseInt(index.toString(), 10)];
15665
15798
  }
15666
15799
  }
15667
15800
  destroy() {
@@ -15859,7 +15992,7 @@ let Schedule = class Schedule extends Component {
15859
15992
  }
15860
15993
  getViewIndex(viewName) {
15861
15994
  for (let item = 0; item < this.viewCollections.length; item++) {
15862
- const checkIndex = this.viewCollections[item].option;
15995
+ const checkIndex = this.viewCollections[parseInt(item.toString(), 10)].option;
15863
15996
  if (checkIndex === viewName) {
15864
15997
  return item;
15865
15998
  }
@@ -15894,6 +16027,7 @@ let Schedule = class Schedule extends Component {
15894
16027
  const fieldViewName = viewName.charAt(0).toLowerCase() + viewName.slice(1);
15895
16028
  obj.cellHeaderTemplateName = obj.cellHeaderTemplate ? obj.option : '';
15896
16029
  obj.dateHeaderTemplateName = obj.dateHeaderTemplate ? obj.option : '';
16030
+ obj.dateRangeTemplateName = obj.dateRangeTemplate ? obj.option : '';
15897
16031
  obj.cellTemplateName = obj.cellTemplate ? obj.option : '';
15898
16032
  obj.dayHeaderTemplateName = obj.dayHeaderTemplate ? obj.option : '';
15899
16033
  obj.monthHeaderTemplateName = obj.monthHeaderTemplate ? obj.option : '';
@@ -15907,11 +16041,11 @@ let Schedule = class Schedule extends Component {
15907
16041
  delete obj.interval;
15908
16042
  }
15909
16043
  this.viewCollections.push(obj);
15910
- if (isNullOrUndefined(this.viewOptions[fieldViewName])) {
15911
- this.viewOptions[fieldViewName] = [obj];
16044
+ if (isNullOrUndefined(this.viewOptions[`${fieldViewName}`])) {
16045
+ this.viewOptions[`${fieldViewName}`] = [obj];
15912
16046
  }
15913
16047
  else {
15914
- this.viewOptions[fieldViewName].push(obj);
16048
+ this.viewOptions[`${fieldViewName}`].push(obj);
15915
16049
  }
15916
16050
  count++;
15917
16051
  }
@@ -15939,7 +16073,8 @@ let Schedule = class Schedule extends Component {
15939
16073
  allowGroupEdit: this.group.allowGroupEdit,
15940
16074
  resources: this.group.resources,
15941
16075
  headerTooltipTemplate: this.group.headerTooltipTemplate,
15942
- enableCompactView: this.group.enableCompactView
16076
+ enableCompactView: this.group.enableCompactView,
16077
+ hideNonWorkingDays: ['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.currentView) > -1 ? this.group.hideNonWorkingDays : false
15943
16078
  };
15944
16079
  const workDays = this.viewCollections[this.viewIndex].workDays ? [] : this.workDays;
15945
16080
  const scheduleOptions = {
@@ -15956,6 +16091,7 @@ let Schedule = class Schedule extends Component {
15956
16091
  cellTemplate: this.cellTemplate,
15957
16092
  eventTemplate: this.eventSettings.template,
15958
16093
  dateHeaderTemplate: this.dateHeaderTemplate,
16094
+ dateRangeTemplate: this.dateRangeTemplate,
15959
16095
  resourceHeaderTemplate: this.resourceHeaderTemplate,
15960
16096
  headerIndentTemplate: this.headerIndentTemplate,
15961
16097
  firstMonthOfYear: this.firstMonthOfYear,
@@ -16035,6 +16171,7 @@ let Schedule = class Schedule extends Component {
16035
16171
  this.monthHeaderTemplateFn = this.templateParser(this.activeViewOptions.monthHeaderTemplate);
16036
16172
  this.cellTemplateFn = this.templateParser(this.activeViewOptions.cellTemplate);
16037
16173
  this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
16174
+ this.dateRangeTemplateFn = this.templateParser(this.activeViewOptions.dateRangeTemplate);
16038
16175
  this.majorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate);
16039
16176
  this.minorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate);
16040
16177
  this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);
@@ -16145,16 +16282,18 @@ let Schedule = class Schedule extends Component {
16145
16282
  if (!muteOnChange && index === this.viewIndex && this.currentView === view || index < 0) {
16146
16283
  return;
16147
16284
  }
16148
- this.viewIndex = index;
16285
+ const previousView = this.activeViewOptions ? this.activeViewOptions.option : this.currentView;
16149
16286
  let args = { requestType: 'viewNavigate', cancel: false, event: event };
16150
16287
  this.trigger(actionBegin, args, (actionArgs) => {
16151
16288
  if (!actionArgs.cancel) {
16152
16289
  const navArgs = {
16153
- action: 'view', cancel: false, currentDate: this.selectedDate, previousView: this.currentView, currentView: view, viewIndex: this.viewIndex
16290
+ action: 'view', cancel: false, currentDate: this.selectedDate, previousView: previousView, currentView: view, viewIndex: index
16154
16291
  };
16155
16292
  this.trigger(navigating, navArgs, (navigationArgs) => {
16156
16293
  if (!navigationArgs.cancel) {
16157
- this.uiStateValues.isInitial = view.indexOf('Timeline') > -1 || this.currentView.indexOf('Timeline') > -1 ? true : this.uiStateValues.isInitial;
16294
+ const isVertical = ['Day', 'Week', 'WorkWeek'].indexOf(view) > -1 && ['Day', 'Week', 'WorkWeek'].indexOf(previousView) < 0;
16295
+ this.uiStateValues.isInitial = isVertical || view.indexOf('Timeline') > -1 || view.indexOf('Year') > -1;
16296
+ this.uiStateValues.top = view.indexOf('Timeline') > -1 && previousView.indexOf('Timeline') < 0 ? 0 : this.uiStateValues.top;
16158
16297
  this.viewIndex = navigationArgs.viewIndex;
16159
16298
  this.setProperties({ currentView: view }, true);
16160
16299
  if (this.headerModule) {
@@ -16167,8 +16306,14 @@ let Schedule = class Schedule extends Component {
16167
16306
  args = { requestType: 'viewNavigate', cancel: false, event: event };
16168
16307
  this.trigger(actionComplete, args);
16169
16308
  }
16309
+ else {
16310
+ this.currentView = previousView;
16311
+ }
16170
16312
  });
16171
16313
  }
16314
+ else {
16315
+ this.currentView = previousView;
16316
+ }
16172
16317
  });
16173
16318
  }
16174
16319
  /**
@@ -16188,7 +16333,7 @@ let Schedule = class Schedule extends Component {
16188
16333
  };
16189
16334
  this.trigger(navigating, navArgs, (navigationArgs) => {
16190
16335
  if (!navigationArgs.cancel) {
16191
- this.uiStateValues.isInitial = this.activeView.isTimelineView() ? true : this.uiStateValues.isInitial;
16336
+ this.uiStateValues.isInitial = this.activeView.isTimelineView() && this.currentView !== 'TimelineYear';
16192
16337
  this.validateDate(navigationArgs.currentDate);
16193
16338
  if (this.headerModule) {
16194
16339
  this.headerModule.setCalendarDate(navigationArgs.currentDate);
@@ -16590,6 +16735,15 @@ let Schedule = class Schedule extends Component {
16590
16735
  getDateHeaderTemplate() {
16591
16736
  return this.dateHeaderTemplateFn;
16592
16737
  }
16738
+ /**
16739
+ * Method to process date range template
16740
+ *
16741
+ * @returns {CallbackFunction} Returns the callback function
16742
+ * @private
16743
+ */
16744
+ getDateRangeTemplate() {
16745
+ return this.dateRangeTemplateFn;
16746
+ }
16593
16747
  /**
16594
16748
  * Method to process major slot template
16595
16749
  *
@@ -16948,14 +17102,14 @@ let Schedule = class Schedule extends Component {
16948
17102
  case 'dateFormat':
16949
17103
  this.activeViewOptions = this.getActiveViewOptions();
16950
17104
  if (this.headerModule) {
16951
- this.headerModule.updateDateRange(this.activeView.getDateRangeText());
17105
+ this.headerModule.updateDateRange();
16952
17106
  }
16953
17107
  break;
16954
17108
  case 'showHeaderBar':
16955
17109
  this.destroyHeaderModule();
16956
17110
  if (newProp.showHeaderBar) {
16957
17111
  this.headerModule = new HeaderRenderer(this);
16958
- this.headerModule.updateDateRange(this.activeView.getDateRangeText());
17112
+ this.headerModule.updateDateRange();
16959
17113
  }
16960
17114
  this.notify(scrollUiUpdate, { cssProperties: this.getCssProperties() });
16961
17115
  if (this.activeView.isTimelineView()) {
@@ -17012,6 +17166,13 @@ let Schedule = class Schedule extends Component {
17012
17166
  this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
17013
17167
  state.isLayout = true;
17014
17168
  break;
17169
+ case 'dateRangeTemplate':
17170
+ this.activeViewOptions.dateRangeTemplate = newProp.dateRangeTemplate;
17171
+ this.dateRangeTemplateFn = this.templateParser(this.activeViewOptions.dateRangeTemplate);
17172
+ if (this.headerModule) {
17173
+ this.headerModule.updateDateRange();
17174
+ }
17175
+ break;
17015
17176
  case 'dayHeaderTemplate':
17016
17177
  this.activeViewOptions.dayHeaderTemplate = newProp.dayHeaderTemplate;
17017
17178
  this.dayHeaderTemplateFn = this.templateParser(this.activeViewOptions.dayHeaderTemplate);
@@ -17191,7 +17352,7 @@ let Schedule = class Schedule extends Component {
17191
17352
  if (this.showHeaderBar && this.headerModule) {
17192
17353
  this.destroyHeaderModule();
17193
17354
  this.headerModule = new HeaderRenderer(this);
17194
- this.headerModule.updateDateRange(this.activeView.getDateRangeText());
17355
+ this.headerModule.updateDateRange();
17195
17356
  }
17196
17357
  state.isLayout = true;
17197
17358
  break;
@@ -17213,7 +17374,7 @@ let Schedule = class Schedule extends Component {
17213
17374
  onGroupSettingsPropertyChanged(newProp, oldProp, state) {
17214
17375
  for (const prop of Object.keys(newProp)) {
17215
17376
  if (prop === 'headerTooltipTemplate') {
17216
- this.headerTooltipTemplateFn = this.templateParser(newProp[prop]);
17377
+ this.headerTooltipTemplateFn = this.templateParser(newProp.headerTooltipTemplate);
17217
17378
  }
17218
17379
  else {
17219
17380
  state.isLayout = true;
@@ -17385,7 +17546,7 @@ let Schedule = class Schedule extends Component {
17385
17546
  resetTime(date);
17386
17547
  let renderDates = this.activeView.renderDates;
17387
17548
  if (!isNullOrUndefined(groupIndex) && this.resourceBase && !this.activeView.isTimelineView()) {
17388
- renderDates = this.resourceBase.lastResourceLevel[groupIndex].renderDates;
17549
+ renderDates = this.resourceBase.lastResourceLevel[parseInt(groupIndex.toString(), 10)].renderDates;
17389
17550
  }
17390
17551
  const colIndex = this.getIndexOfDate(renderDates, date);
17391
17552
  if (colIndex >= 0) {
@@ -17397,16 +17558,16 @@ let Schedule = class Schedule extends Component {
17397
17558
  for (let i = startIndex; i < endIndex; i++) {
17398
17559
  if (this.activeView.isTimelineView()) {
17399
17560
  const rowIndex = (!isNullOrUndefined(groupIndex)) ? groupIndex : 0;
17400
- cells.push(tableEle.rows[rowIndex].cells[i]);
17561
+ cells.push(tableEle.rows[parseInt(rowIndex.toString(), 10)].cells[parseInt(i.toString(), 10)]);
17401
17562
  }
17402
17563
  else {
17403
17564
  if (!isNullOrUndefined(groupIndex)) {
17404
17565
  const selector = '.' + WORK_CELLS_CLASS + '[data-group-index="' + groupIndex + '"]';
17405
- const tds = [].slice.call(tableEle.rows[i].querySelectorAll(selector));
17406
- cells.push(tds[colIndex]);
17566
+ const tds = [].slice.call(tableEle.rows[parseInt(i.toString(), 10)].querySelectorAll(selector));
17567
+ cells.push(tds[parseInt(colIndex.toString(), 10)]);
17407
17568
  }
17408
17569
  else {
17409
- cells.push(tableEle.rows[i].cells[colIndex]);
17570
+ cells.push(tableEle.rows[parseInt(i.toString(), 10)].cells[parseInt(colIndex.toString(), 10)]);
17410
17571
  }
17411
17572
  }
17412
17573
  }
@@ -17491,7 +17652,7 @@ let Schedule = class Schedule extends Component {
17491
17652
  changeCurrentView(viewName, viewIndex) {
17492
17653
  let index = this.getViewIndex(viewName);
17493
17654
  const view = viewName.charAt(0).toLowerCase() + viewName.slice(1);
17494
- const viewOptions = this.viewOptions[view];
17655
+ const viewOptions = this.viewOptions[`${view}`];
17495
17656
  if (viewOptions) {
17496
17657
  index = this.viewCollections.indexOf(viewOptions[viewIndex || 0]);
17497
17658
  }
@@ -17520,7 +17681,7 @@ let Schedule = class Schedule extends Component {
17520
17681
  if (index < 0 || index >= this.resourceBase.lastResourceLevel.length) {
17521
17682
  return undefined;
17522
17683
  }
17523
- const data = this.resourceBase.lastResourceLevel[index];
17684
+ const data = this.resourceBase.lastResourceLevel[parseInt(index.toString(), 10)];
17524
17685
  const groupData = {};
17525
17686
  this.resourceBase.setResourceValues(groupData, index);
17526
17687
  return { resource: data.resource, resourceData: data.resourceData, groupData: groupData };
@@ -17861,6 +18022,12 @@ let Schedule = class Schedule extends Component {
17861
18022
  this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
17862
18023
  this.activeView.refreshHeader();
17863
18024
  break;
18025
+ case 'dateRangeTemplate':
18026
+ this.dateRangeTemplateFn = this.templateParser(this.activeViewOptions.dateRangeTemplate);
18027
+ if (this.headerModule) {
18028
+ this.headerModule.refresh();
18029
+ }
18030
+ break;
17864
18031
  case 'resourceHeaderTemplate':
17865
18032
  this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);
17866
18033
  if (this.activeView.isTimelineView()) {
@@ -17965,7 +18132,8 @@ let Schedule = class Schedule extends Component {
17965
18132
  eventEnd = this.getDateTime(eventEnd);
17966
18133
  let eventCollection = this.eventBase.filterEvents(eventStart, eventEnd);
17967
18134
  if (!isNullOrUndefined(groupIndex) && this.resourceBase && this.resourceBase.lastResourceLevel.length > 0) {
17968
- eventCollection = this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[groupIndex], eventCollection);
18135
+ eventCollection =
18136
+ this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(groupIndex.toString(), 10)], eventCollection);
17969
18137
  }
17970
18138
  if (eventObj) {
17971
18139
  if (eventObj.Guid) {
@@ -18091,6 +18259,19 @@ let Schedule = class Schedule extends Component {
18091
18259
  this.quickPopup.quickPopupHide(true);
18092
18260
  }
18093
18261
  }
18262
+ /**
18263
+ * Closes the tooltip.
18264
+ * For example, when the context menu is opened for an event,
18265
+ * the tooltip can be closed by calling this method.
18266
+ *
18267
+ * @function closeTooltip
18268
+ * @returns {void}
18269
+ */
18270
+ closeTooltip() {
18271
+ if (this.eventTooltip) {
18272
+ this.eventTooltip.close();
18273
+ }
18274
+ }
18094
18275
  /**
18095
18276
  * Select the resource based on group index in mobile mode.
18096
18277
  *
@@ -18202,7 +18383,7 @@ let Schedule = class Schedule extends Component {
18202
18383
  'activeEventData', 'activeCellsData', 'renderModule'
18203
18384
  ];
18204
18385
  for (const module of modules) {
18205
- this[module] = null;
18386
+ this[`${module}`] = null;
18206
18387
  }
18207
18388
  removeChildren(this.element);
18208
18389
  let removeClasses = [ROOT, RTL, DEVICE_CLASS, MULTI_DRAG];
@@ -18296,6 +18477,9 @@ __decorate([
18296
18477
  __decorate([
18297
18478
  Property()
18298
18479
  ], Schedule.prototype, "dateHeaderTemplate", void 0);
18480
+ __decorate([
18481
+ Property()
18482
+ ], Schedule.prototype, "dateRangeTemplate", void 0);
18299
18483
  __decorate([
18300
18484
  Property()
18301
18485
  ], Schedule.prototype, "cellHeaderTemplate", void 0);
@@ -18593,8 +18777,8 @@ class ActionBase {
18593
18777
  let startTime = this.actionObj.start;
18594
18778
  let endTime = this.actionObj.end;
18595
18779
  if (multiData && multiData.length > 0) {
18596
- startTime = multiData[index][this.parent.eventFields.startTime];
18597
- endTime = multiData[index][this.parent.eventFields.endTime];
18780
+ startTime = multiData[parseInt(index.toString(), 10)][this.parent.eventFields.startTime];
18781
+ endTime = multiData[parseInt(index.toString(), 10)][this.parent.eventFields.endTime];
18598
18782
  }
18599
18783
  timeElement.innerHTML = this.parent.getTimeString(startTime) + ' - ' +
18600
18784
  this.parent.getTimeString(endTime);
@@ -18881,7 +19065,7 @@ class ActionBase {
18881
19065
  addClass([appointmentElement], CLONE_ELEMENT_CLASS);
18882
19066
  this.monthEvent.applyResourceColor(appointmentElement, event, 'backgroundColor', groupOrder);
18883
19067
  setStyleAttribute(appointmentElement, { 'width': appWidth + 'px', 'border': '0px', 'pointer-events': 'none' });
18884
- const cellTd = workCells[day];
19068
+ const cellTd = workCells[parseInt(day.toString(), 10)];
18885
19069
  if (cellTd && isNullOrUndefined(this.parent.eventDragArea)) {
18886
19070
  this.monthEvent.renderElement(cellTd, appointmentElement, true);
18887
19071
  this.actionObj.cloneElement.push(appointmentElement);
@@ -18913,9 +19097,9 @@ class Resize extends ActionBase {
18913
19097
  resizeHelper() {
18914
19098
  if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.activeViewOptions.group.allowGroupEdit) {
18915
19099
  for (let i = 0, len = this.actionObj.originalElement.length; i < len; i++) {
18916
- const cloneElement = this.createCloneElement(this.actionObj.originalElement[i]);
18917
- this.actionObj.cloneElement[i] = cloneElement;
18918
- if (this.actionObj.element === this.actionObj.originalElement[i]) {
19100
+ const cloneElement = this.createCloneElement(this.actionObj.originalElement[parseInt(i.toString(), 10)]);
19101
+ this.actionObj.cloneElement[parseInt(i.toString(), 10)] = cloneElement;
19102
+ if (this.actionObj.element === this.actionObj.originalElement[parseInt(i.toString(), 10)]) {
18919
19103
  this.actionObj.clone = cloneElement;
18920
19104
  }
18921
19105
  }
@@ -19271,10 +19455,10 @@ class Resize extends ActionBase {
19271
19455
  }
19272
19456
  let resizeDate;
19273
19457
  if (['Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1) {
19274
- resizeDate = new Date(this.parent.activeView.renderDates[cellIndex].getTime());
19458
+ resizeDate = new Date(this.parent.activeView.renderDates[parseInt(cellIndex.toString(), 10)].getTime());
19275
19459
  }
19276
19460
  else {
19277
- resizeDate = this.parent.getDateFromElement(tr.children[cellIndex]);
19461
+ resizeDate = this.parent.getDateFromElement(tr.children[parseInt(cellIndex.toString(), 10)]);
19278
19462
  }
19279
19463
  if (['TimelineMonth', 'Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1 ||
19280
19464
  !this.parent.activeViewOptions.timeScale.enable) {
@@ -19301,7 +19485,7 @@ class Resize extends ActionBase {
19301
19485
  const tr = closest(this.actionObj.clone, 'tr');
19302
19486
  let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
19303
19487
  dayIndex = this.getIndex(dayIndex);
19304
- resizeTime = this.parent.getDateFromElement(tr.children[dayIndex]);
19488
+ resizeTime = this.parent.getDateFromElement(tr.children[parseInt(dayIndex.toString(), 10)]);
19305
19489
  if (isLeft) {
19306
19490
  resizeTime.setHours(eventStart.getHours(), eventStart.getMinutes(), eventStart.getSeconds());
19307
19491
  }
@@ -19501,14 +19685,17 @@ class YearEvent extends TimelineEvent {
19501
19685
  for (let index = 0; startDate.getTime() < endDate.getTime(); index++) {
19502
19686
  const start = resetTime(new Date(startDate.getTime()));
19503
19687
  const end = addDays(new Date(start.getTime()), 1);
19688
+ startDate = addDays(new Date(startDate.getTime()), 1);
19689
+ if (!this.parent.isMinMaxDate(start)) {
19690
+ continue;
19691
+ }
19504
19692
  const filterEvents = this.parent.eventBase.filterEvents(start, end);
19505
19693
  if (filterEvents.length > 0) {
19506
- const workCell = workCells[index];
19694
+ const workCell = workCells[parseInt(index.toString(), 10)];
19507
19695
  if (workCell) {
19508
19696
  workCell.appendChild(createElement('div', { className: APPOINTMENT_CLASS }));
19509
19697
  }
19510
19698
  }
19511
- startDate = addDays(new Date(startDate.getTime()), 1);
19512
19699
  }
19513
19700
  }
19514
19701
  }
@@ -19520,12 +19707,14 @@ class YearEvent extends TimelineEvent {
19520
19707
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
19521
19708
  const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
19522
19709
  const months = this.getMonths();
19710
+ const groupIndex = (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.uiStateValues.isGroupAdaptive) ?
19711
+ this.parent.uiStateValues.groupIndex : undefined;
19523
19712
  for (let row = 0; row < months.length; row++) {
19524
- const wrapper = wrapperCollection[row];
19713
+ const wrapper = wrapperCollection[parseInt(row.toString(), 10)];
19525
19714
  let td = row + 1;
19526
19715
  const eventWrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
19527
19716
  wrapper.appendChild(eventWrapper);
19528
- let monthStart = new Date(this.parent.selectedDate.getFullYear(), months[row], 1);
19717
+ let monthStart = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(row.toString(), 10)], 1);
19529
19718
  const monthEnd = new Date(monthStart.getFullYear(), monthStart.getMonth() + 1, 0);
19530
19719
  let dayIndex = monthStart.getDay();
19531
19720
  const isSpannedCollection = [];
@@ -19536,7 +19725,7 @@ class YearEvent extends TimelineEvent {
19536
19725
  let leftValue;
19537
19726
  let rightValue;
19538
19727
  if (this.parent.activeViewOptions.orientation === 'Vertical') {
19539
- const wrapper = wrapperCollection[dayIndex];
19728
+ const wrapper = wrapperCollection[parseInt(dayIndex.toString(), 10)];
19540
19729
  td = dayIndex + 1;
19541
19730
  let eventWrapper = wrapper.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
19542
19731
  if (!eventWrapper) {
@@ -19569,7 +19758,7 @@ class YearEvent extends TimelineEvent {
19569
19758
  let dayEvents = this.parent.eventBase.filterEvents(dayStart, dayEnd, undefined, resource);
19570
19759
  dayEvents = this.parent.eventBase.sortByDateTime(dayEvents);
19571
19760
  for (let index = 0, count = dayEvents.length; index < count; index++) {
19572
- const eventData = extend({}, dayEvents[index], null, true);
19761
+ const eventData = extend({}, dayEvents[parseInt(index.toString(), 10)], null, true);
19573
19762
  this.updateSpannedEvents(eventData, dayStart, dayEnd);
19574
19763
  const overlapIndex = this.getIndex(dayStart);
19575
19764
  eventData.Index = overlapIndex;
@@ -19583,7 +19772,7 @@ class YearEvent extends TimelineEvent {
19583
19772
  const isSpanned = isSpannedCollection.filter((eventObj) => eventObj.Guid === eventData.Guid);
19584
19773
  if (isRendered.length > 0 && isRendered[0].MoreIndicator || isSpanned.length > 0 && isSpanned[0].MoreIndicator) {
19585
19774
  const moreIndex = this.parent.activeViewOptions.orientation === 'Horizontal' ? row : dayIndex;
19586
- this.renderMoreIndicator(eventWrapper, moreIndicatorCount, dayStart, moreIndex, leftValue, rightValue);
19775
+ this.renderMoreIndicator(eventWrapper, moreIndicatorCount, dayStart, moreIndex, leftValue, rightValue, groupIndex);
19587
19776
  continue;
19588
19777
  }
19589
19778
  else if (isRendered.length > 0 || isSpanned.length > 0) {
@@ -19598,7 +19787,7 @@ class YearEvent extends TimelineEvent {
19598
19787
  }
19599
19788
  else {
19600
19789
  const moreIndex = this.parent.activeViewOptions.orientation === 'Horizontal' ? row : dayIndex;
19601
- this.renderMoreIndicator(eventWrapper, moreIndicatorCount, dayStart, moreIndex, leftValue, rightValue);
19790
+ this.renderMoreIndicator(eventWrapper, moreIndicatorCount, dayStart, moreIndex, leftValue, rightValue, groupIndex);
19602
19791
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
19603
19792
  eventData.MoreIndicator = true;
19604
19793
  this.renderedEvents.push(eventData);
@@ -19651,10 +19840,10 @@ class YearEvent extends TimelineEvent {
19651
19840
  const months = this.getMonths();
19652
19841
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
19653
19842
  for (let month = 0; month < months.length; month++) {
19654
- const monthStart = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
19843
+ const monthStart = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(month.toString(), 10)], 1);
19655
19844
  for (let i = 0, len = resources.length; i < len; i++) {
19656
19845
  this.renderedEvents = [];
19657
- this.renderResourceEvent(wrapperCollection[month], resources[i], month, i, monthStart);
19846
+ this.renderResourceEvent(wrapperCollection[parseInt(month.toString(), 10)], resources[parseInt(i.toString(), 10)], month, i, monthStart);
19658
19847
  }
19659
19848
  }
19660
19849
  }
@@ -19662,8 +19851,8 @@ class YearEvent extends TimelineEvent {
19662
19851
  for (let i = 0, len = resources.length; i < len; i++) {
19663
19852
  this.renderedEvents = [];
19664
19853
  for (let month = 0; month < months.length; month++) {
19665
- const monthStart = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
19666
- this.renderResourceEvent(wrapperCollection[i], resources[i], month, i, monthStart);
19854
+ const monthStart = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(month.toString(), 10)], 1);
19855
+ this.renderResourceEvent(wrapperCollection[parseInt(i.toString(), 10)], resources[parseInt(i.toString(), 10)], month, i, monthStart);
19667
19856
  }
19668
19857
  }
19669
19858
  }
@@ -19678,7 +19867,7 @@ class YearEvent extends TimelineEvent {
19678
19867
  this.cellHeight = td.offsetHeight;
19679
19868
  this.groupOrder = resource.groupOrder;
19680
19869
  for (let a = 0; a < eventDatas.length; a++) {
19681
- const data = eventDatas[a];
19870
+ const data = eventDatas[parseInt(a.toString(), 10)];
19682
19871
  let overlapIndex;
19683
19872
  const eventData = extend({}, data, null, true);
19684
19873
  if (this.parent.activeViewOptions.group.resources.length > 0) {
@@ -19693,6 +19882,9 @@ class YearEvent extends TimelineEvent {
19693
19882
  const availedHeight = this.cellHeader + (this.eventHeight * (a + 1)) + EVENT_GAP$2 + this.moreIndicatorHeight;
19694
19883
  const leftValue = (this.parent.activeViewOptions.orientation === 'Vertical') ?
19695
19884
  month * this.cellWidth : index * this.cellWidth;
19885
+ if (!this.parent.isMinMaxDate(eventData[this.fields.startTime])) {
19886
+ return;
19887
+ }
19696
19888
  if (this.parent.rowAutoHeight || this.cellHeight > availedHeight) {
19697
19889
  this.renderEvent(eventWrapper, eventData, month, leftValue, leftValue, monthStart, index);
19698
19890
  this.updateCellHeight(td, availedHeight);
@@ -19702,7 +19894,7 @@ class YearEvent extends TimelineEvent {
19702
19894
  this.renderMoreIndicator(eventWrapper, eventDatas.length - a, monthStart, moreIndex, leftValue, leftValue, index);
19703
19895
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
19704
19896
  for (let i = index; i < eventDatas.length; i++) {
19705
- this.renderedEvents.push(extend({}, eventDatas[i], { Index: overlapIndex + i }, true));
19897
+ this.renderedEvents.push(extend({}, eventDatas[parseInt(i.toString(), 10)], { Index: overlapIndex + i }, true));
19706
19898
  }
19707
19899
  }
19708
19900
  break;
@@ -19762,7 +19954,7 @@ class YearEvent extends TimelineEvent {
19762
19954
  return;
19763
19955
  }
19764
19956
  let endDate;
19765
- if (this.parent.activeViewOptions.group.resources.length > 0) {
19957
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19766
19958
  endDate = addDays(lastDateOfMonth(new Date(startDate.getTime())), 1);
19767
19959
  }
19768
19960
  else {
@@ -19865,7 +20057,7 @@ class YearEvent extends TimelineEvent {
19865
20057
  eventData[this.fields.endTime] = monthEnd;
19866
20058
  isSpanned.isRight = true;
19867
20059
  }
19868
- if (this.parent.activeViewOptions.group.resources.length === 0) {
20060
+ if (this.parent.activeViewOptions.group.resources.length === 0 || this.parent.uiStateValues.isGroupAdaptive) {
19869
20061
  let end = resetTime(eventData[this.fields.endTime]).getTime();
19870
20062
  const start = resetTime(eventData[this.fields.startTime]).getTime();
19871
20063
  if (eventObj[this.fields.isAllDay] && end === eventObj[this.fields.endTime].getTime() || isSpanned.isRight) {
@@ -19886,7 +20078,7 @@ class YearEvent extends TimelineEvent {
19886
20078
  const appointmentsList = [];
19887
20079
  let dateStart;
19888
20080
  let dateEnd;
19889
- if (this.parent.activeViewOptions.group.resources.length > 0) {
20081
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19890
20082
  const monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(date.getTime()));
19891
20083
  const monthEnd = addDays(this.parent.calendarUtil.getMonthEndDate(new Date(date.getTime())), -1);
19892
20084
  dateStart = resetTime(new Date(monthStart.getTime())).getTime();
@@ -20306,7 +20498,8 @@ class DragAndDrop extends ActionBase {
20306
20498
  this.parent.crudModule.crudObj.sourceEvent =
20307
20499
  [this.parent.resourceBase.lastResourceLevel[parseInt(dragArgs.element.getAttribute('data-group-index'), 10)]];
20308
20500
  const currentGroupIndex = parseInt(dragArgs.target.getAttribute('data-group-index'), 10) || this.actionObj.groupIndex;
20309
- this.parent.crudModule.crudObj.targetEvent = [this.parent.resourceBase.lastResourceLevel[currentGroupIndex]];
20501
+ this.parent.crudModule.crudObj.targetEvent =
20502
+ [this.parent.resourceBase.lastResourceLevel[parseInt(currentGroupIndex.toString(), 10)]];
20310
20503
  }
20311
20504
  this.saveChangedData(dragEventArgs, this.isMultiSelect);
20312
20505
  });
@@ -20498,7 +20691,7 @@ class DragAndDrop extends ActionBase {
20498
20691
  }
20499
20692
  else {
20500
20693
  const trCollections = [].slice.call(this.parent.getContentTable().querySelectorAll('tr'));
20501
- tr = trCollections[rowIndex];
20694
+ tr = trCollections[parseInt(rowIndex.toString(), 10)];
20502
20695
  }
20503
20696
  let index;
20504
20697
  if (closest(this.actionObj.target, 'td').classList.contains(WORK_CELLS_CLASS) ||
@@ -20510,7 +20703,7 @@ class DragAndDrop extends ActionBase {
20510
20703
  if (isNullOrUndefined(tr)) {
20511
20704
  return;
20512
20705
  }
20513
- const td = tr.children[colIndex];
20706
+ const td = tr.children[parseInt(colIndex.toString(), 10)];
20514
20707
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
20515
20708
  this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
20516
20709
  }
@@ -20574,16 +20767,17 @@ class DragAndDrop extends ActionBase {
20574
20767
  }
20575
20768
  const startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
20576
20769
  for (let index = 0; index < this.multiData.length; index++) {
20577
- this.updatedData[index] = this.updateMultipleData(this.multiData[index], startTimeDiff);
20578
- const dayIndex = this.getDayIndex(this.updatedData[index]);
20770
+ this.updatedData[parseInt(index.toString(), 10)] =
20771
+ this.updateMultipleData(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
20772
+ const dayIndex = this.getDayIndex(this.updatedData[parseInt(index.toString(), 10)]);
20579
20773
  if (dayIndex >= 0) {
20580
- const wrapper = this.getEventWrapper(dayIndex, this.updatedData[index][this.parent.eventFields.isAllDay]);
20581
- this.appendCloneElement(wrapper, this.actionObj.cloneElement[index]);
20582
- this.updateEventHeight(this.updatedData[index], index, dayIndex);
20774
+ const wrapper = this.getEventWrapper(dayIndex, this.updatedData[parseInt(index.toString(), 10)][this.parent.eventFields.isAllDay]);
20775
+ this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
20776
+ this.updateEventHeight(this.updatedData[parseInt(index.toString(), 10)], index, dayIndex);
20583
20777
  }
20584
20778
  else {
20585
- if (!isNullOrUndefined(this.actionObj.cloneElement[index].parentNode)) {
20586
- remove(this.actionObj.cloneElement[index]);
20779
+ if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index.toString(), 10)].parentNode)) {
20780
+ remove(this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
20587
20781
  }
20588
20782
  }
20589
20783
  }
@@ -20611,7 +20805,7 @@ class DragAndDrop extends ActionBase {
20611
20805
  }
20612
20806
  const index = eventData.length - 1;
20613
20807
  eventData[0][eventFields.startTime] = startTime;
20614
- eventData[index][eventFields.endTime] = endTime;
20808
+ eventData[parseInt(index.toString(), 10)][eventFields.endTime] = endTime;
20615
20809
  }
20616
20810
  else {
20617
20811
  eventData.push(event);
@@ -20668,8 +20862,8 @@ class DragAndDrop extends ActionBase {
20668
20862
  let datesCount = this.verticalEvent.getStartCount();
20669
20863
  if (!this.parent.uiStateValues.isGroupAdaptive) {
20670
20864
  for (let i = 0; i < this.actionObj.groupIndex; i++) {
20671
- if (this.verticalEvent.dateRender[i]) {
20672
- datesCount = datesCount + this.verticalEvent.dateRender[i].length;
20865
+ if (this.verticalEvent.dateRender[parseInt(i.toString(), 10)]) {
20866
+ datesCount = datesCount + this.verticalEvent.dateRender[parseInt(i.toString(), 10)].length;
20673
20867
  }
20674
20868
  }
20675
20869
  }
@@ -20680,7 +20874,7 @@ class DragAndDrop extends ActionBase {
20680
20874
  let dynamicIndex = -1;
20681
20875
  let dayIndex = !this.parent.activeViewOptions.group.byDate ?
20682
20876
  isNullOrUndefined(index) ? this.actionObj.index - datesCount : colIndex - datesCount
20683
- : this.parent.getIndexOfDate(this.verticalEvent.dateRender[indexGroup], resetTime(
20877
+ : this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(indexGroup.toString(), 10)], resetTime(
20684
20878
  // eslint-disable-next-line max-len
20685
20879
  this.parent.getDateFromElement(isNullOrUndefined(index) ? this.actionObj.target : this.targetTd)));
20686
20880
  const splitEvents = this.splitEvent(event);
@@ -20688,7 +20882,7 @@ class DragAndDrop extends ActionBase {
20688
20882
  this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' ? [event] : splitEvents;
20689
20883
  for (let i = 0; i < events.length; i++) {
20690
20884
  if (i > 0) {
20691
- let filterQuery = `.e-day-wrapper[data-date="${resetTime(events[i][this.parent.eventFields.startTime]).getTime()}"]`;
20885
+ let filterQuery = `.e-day-wrapper[data-date="${resetTime(events[parseInt(i.toString(), 10)][this.parent.eventFields.startTime]).getTime()}"]`;
20692
20886
  if (this.parent.activeViewOptions.group.resources.length > 0) {
20693
20887
  filterQuery = filterQuery.concat('[data-group-index = "' + this.actionObj.groupIndex + '"]');
20694
20888
  }
@@ -20702,7 +20896,7 @@ class DragAndDrop extends ActionBase {
20702
20896
  }
20703
20897
  }
20704
20898
  if (dayIndex >= 0) {
20705
- const record = this.verticalEvent.isSpannedEvent(events[i], dayIndex, indexGroup);
20899
+ const record = this.verticalEvent.isSpannedEvent(events[parseInt(i.toString(), 10)], dayIndex, indexGroup);
20706
20900
  const eStart = record[this.verticalEvent.fields.startTime];
20707
20901
  const eEnd = record[this.verticalEvent.fields.endTime];
20708
20902
  let appHeight = this.parent.activeViewOptions.timeScale.enable ? this.verticalEvent.getHeight(eStart, eEnd) :
@@ -20730,12 +20924,12 @@ class DragAndDrop extends ActionBase {
20730
20924
  appWidth = (allDayDifference * this.actionObj.cellWidth);
20731
20925
  }
20732
20926
  }
20733
- if (this.actionObj.cloneElement[index]) {
20927
+ if (this.actionObj.cloneElement[parseInt(index.toString(), 10)]) {
20734
20928
  if (i === 0) {
20735
- this.actionObj.cloneElement[index].style.top = formatUnit(topValue);
20736
- this.actionObj.cloneElement[index].style.height = formatUnit(appHeight);
20737
- this.actionObj.cloneElement[index].style.width = formatUnit(appWidth);
20738
- this.actionObj.cloneElement[index].style.left = formatUnit(0);
20929
+ this.actionObj.cloneElement[parseInt(index.toString(), 10)].style.top = formatUnit(topValue);
20930
+ this.actionObj.cloneElement[parseInt(index.toString(), 10)].style.height = formatUnit(appHeight);
20931
+ this.actionObj.cloneElement[parseInt(index.toString(), 10)].style.width = formatUnit(appWidth);
20932
+ this.actionObj.cloneElement[parseInt(index.toString(), 10)].style.left = formatUnit(0);
20739
20933
  }
20740
20934
  else {
20741
20935
  this.renderSpannedEvents(record, dynamicIndex, topValue, appHeight);
@@ -20760,7 +20954,7 @@ class DragAndDrop extends ActionBase {
20760
20954
  'border': '0px'
20761
20955
  });
20762
20956
  const appointmentWrap = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_WRAPPER_CLASS));
20763
- appointmentWrap[index].appendChild(appointmentElement);
20957
+ appointmentWrap[parseInt(index.toString(), 10)].appendChild(appointmentElement);
20764
20958
  }
20765
20959
  }
20766
20960
  getRenderedDates() {
@@ -20874,12 +21068,13 @@ class DragAndDrop extends ActionBase {
20874
21068
  startTimeDiff += startTime.getMonth();
20875
21069
  }
20876
21070
  for (let index = 0; index < this.multiData.length; index++) {
20877
- this.updatedData[index] = this.updateMultipleVerticalDate(this.multiData[index], startTimeDiff);
21071
+ this.updatedData[parseInt(index.toString(), 10)] =
21072
+ this.updateMultipleVerticalDate(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
20878
21073
  if (this.parent.currentView === 'TimelineYear') {
20879
- this.dynamicYearlyEventsRendering(this.updatedData[index]);
21074
+ this.dynamicYearlyEventsRendering(this.updatedData[parseInt(index.toString(), 10)]);
20880
21075
  }
20881
21076
  else {
20882
- this.dynamicEventsRendering(this.updatedData[index]);
21077
+ this.dynamicEventsRendering(this.updatedData[parseInt(index.toString(), 10)]);
20883
21078
  }
20884
21079
  }
20885
21080
  }
@@ -20942,8 +21137,8 @@ class DragAndDrop extends ActionBase {
20942
21137
  const tr = this.parent.getContentTable().querySelector('tr');
20943
21138
  let index = this.getCursorCurrentIndex(colIndex, cloneIndex, tr);
20944
21139
  index = index < 0 ? 0 : index;
20945
- let eventStart = this.isHeaderRows ? new Date(this.timelineEventModule.dateRender[index].getTime()) :
20946
- this.parent.getDateFromElement(tr.children[index]);
21140
+ let eventStart = this.isHeaderRows ? new Date(this.timelineEventModule.dateRender[parseInt(index.toString(), 10)].getTime()) :
21141
+ this.parent.getDateFromElement(tr.children[parseInt(index.toString(), 10)]);
20947
21142
  if (this.isStepDragging) {
20948
21143
  const widthDiff = this.getWidthDiff(tr, index);
20949
21144
  if (widthDiff !== 0) {
@@ -20994,12 +21189,13 @@ class DragAndDrop extends ActionBase {
20994
21189
  if (this.multiData.length > 0) {
20995
21190
  const startTimeDiff = eventsData[0][this.parent.eventFields.startTime].getTime() - this.startTime;
20996
21191
  for (let i = 0; i < this.multiData.length; i++) {
20997
- this.updatedData[i] = this.updateMultipleData(this.multiData[i], startTimeDiff);
21192
+ this.updatedData[parseInt(i.toString(), 10)] =
21193
+ this.updateMultipleData(this.multiData[parseInt(i.toString(), 10)], startTimeDiff);
20998
21194
  }
20999
21195
  eventsData = this.updatedData;
21000
21196
  }
21001
21197
  for (let dataIndex = 0; dataIndex < eventsData.length; dataIndex++) {
21002
- const events = this.timelineEventModule.splitEvent(eventsData[dataIndex], this.timelineEventModule.dateRender);
21198
+ const events = this.timelineEventModule.splitEvent(eventsData[parseInt(dataIndex.toString(), 10)], this.timelineEventModule.dateRender);
21003
21199
  const eventData = events[0].data;
21004
21200
  const startTime = this.timelineEventModule.getStartTime(events[0], eventData);
21005
21201
  const endTime = this.timelineEventModule.getEndTime(events[0], eventData);
@@ -21009,7 +21205,7 @@ class DragAndDrop extends ActionBase {
21009
21205
  let day = this.parent.getIndexOfDate(this.timelineEventModule.dateRender, resetTime(new Date(startTime.getTime())));
21010
21206
  day = day < 0 ? 0 : day;
21011
21207
  const left = this.timelineEventModule.getPosition(startTime, endTime, eventObj[this.parent.eventFields.isAllDay], day);
21012
- const cloneElement = this.multiData.length > 0 ? this.actionObj.cloneElement[dataIndex] : this.actionObj.clone;
21208
+ const cloneElement = this.multiData.length > 0 ? this.actionObj.cloneElement[parseInt(dataIndex.toString(), 10)] : this.actionObj.clone;
21013
21209
  if (this.parent.enableRtl) {
21014
21210
  cloneElement.style.right = formatUnit(left);
21015
21211
  }
@@ -21069,7 +21265,7 @@ class DragAndDrop extends ActionBase {
21069
21265
  getWidthDiff(tr, index) {
21070
21266
  const pages = this.scrollArgs.element.getBoundingClientRect();
21071
21267
  if (pages.left <= this.actionObj.pageX && pages.right >= this.actionObj.pageX) {
21072
- const targetLeft = tr.children[index].offsetLeft;
21268
+ const targetLeft = tr.children[parseInt(index.toString(), 10)].offsetLeft;
21073
21269
  const pageX = this.actionObj.pageX - pages.left;
21074
21270
  if (this.parent.enableRtl) {
21075
21271
  return (targetLeft + this.actionObj.cellWidth) - (this.scrollArgs.element.scrollLeft + pageX);
@@ -21139,7 +21335,7 @@ class DragAndDrop extends ActionBase {
21139
21335
  const td = closest(this.actionObj.target, 'td');
21140
21336
  this.actionObj.groupIndex = (td && !isNaN(parseInt(td.getAttribute('data-group-index'), 10)))
21141
21337
  ? parseInt(td.getAttribute('data-group-index'), 10) : this.actionObj.groupIndex;
21142
- let top = trCollection[rowIndex].getBoundingClientRect().height * rowIndex;
21338
+ let top = trCollection[parseInt(rowIndex.toString(), 10)].getBoundingClientRect().height * rowIndex;
21143
21339
  if (this.parent.rowAutoHeight) {
21144
21340
  const cursorElement = this.getCursorElement(e);
21145
21341
  if (cursorElement) {
@@ -21220,6 +21416,7 @@ class ViewBase {
21220
21416
  * @param {Schedule} parent Accepts the schedule instance
21221
21417
  */
21222
21418
  constructor(parent) {
21419
+ this.previousNextAction = 'next';
21223
21420
  this.parent = parent;
21224
21421
  }
21225
21422
  isTimelineView() {
@@ -21269,7 +21466,7 @@ class ViewBase {
21269
21466
  for (let row = 0; row < trCount; row++) {
21270
21467
  eventContainer = createElement('div', { className: APPOINTMENT_CONTAINER_CLASS });
21271
21468
  if (this.parent.resourceBase && !this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.renderedResources) {
21272
- eventContainer.setAttribute('data-group-index', this.parent.resourceBase.renderedResources[row].groupIndex.toString());
21469
+ eventContainer.setAttribute('data-group-index', this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)].groupIndex.toString());
21273
21470
  }
21274
21471
  eventRows.push(eventContainer);
21275
21472
  }
@@ -21394,6 +21591,12 @@ class ViewBase {
21394
21591
  highlightCurrentTime() {
21395
21592
  // Here showTimeIndicator functionalities
21396
21593
  }
21594
+ getStartDate() {
21595
+ return this.renderDates[0];
21596
+ }
21597
+ getEndDate() {
21598
+ return this.renderDates[this.renderDates.length - 1];
21599
+ }
21397
21600
  startDate() {
21398
21601
  return this.renderDates[0];
21399
21602
  }
@@ -21492,6 +21695,7 @@ class ViewBase {
21492
21695
  return renderDates;
21493
21696
  }
21494
21697
  getNextPreviousDate(type) {
21698
+ this.previousNextAction = type;
21495
21699
  if (this.parent.currentView === 'Day' || this.parent.currentView === 'TimelineDay') {
21496
21700
  if (this.parent.activeViewOptions.showWeekend) {
21497
21701
  const daysCount = this.parent.activeViewOptions.interval;
@@ -21759,8 +21963,8 @@ class ViewBase {
21759
21963
  if (index >= renderedCount) {
21760
21964
  break;
21761
21965
  }
21762
- index += lastLevel[i].colSpan;
21763
- this.parent.resourceBase.expandedResources.push(lastLevel[i]);
21966
+ index += lastLevel[parseInt(i.toString(), 10)].colSpan;
21967
+ this.parent.resourceBase.expandedResources.push(lastLevel[parseInt(i.toString(), 10)]);
21764
21968
  }
21765
21969
  if (this.parent.activeViewOptions.group.byDate) {
21766
21970
  this.colLevels[0] = this.parent.resourceBase.expandedResources;
@@ -21880,6 +22084,9 @@ class VerticalView extends ViewBase {
21880
22084
  }
21881
22085
  if (!args.isPreventScrollUpdate) {
21882
22086
  if (this.parent.uiStateValues.isInitial) {
22087
+ if (this.parent.currentView.indexOf('Timeline') > -1) {
22088
+ content.scrollTop = this.parent.uiStateValues.top;
22089
+ }
21883
22090
  this.scrollToWorkHour();
21884
22091
  this.parent.uiStateValues.isInitial = false;
21885
22092
  }
@@ -21941,10 +22148,22 @@ class VerticalView extends ViewBase {
21941
22148
  this.scrollToHour(null, scrollDate);
21942
22149
  }
21943
22150
  generateColumnLevels() {
21944
- const level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
22151
+ let level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
21945
22152
  let columnLevels = [];
21946
22153
  if (this.parent.activeViewOptions.group.resources.length > 0) {
21947
22154
  columnLevels = this.parent.resourceBase.generateResourceLevels(level);
22155
+ if (this.parent.activeViewOptions.group.hideNonWorkingDays) {
22156
+ while (columnLevels[0].length === 0) {
22157
+ this.parent.setProperties({ selectedDate: this.parent.activeView.getNextPreviousDate(this.previousNextAction) }, true);
22158
+ this.parent.activeView.getRenderDates();
22159
+ if (this.parent.headerModule) {
22160
+ this.parent.headerModule.setCalendarDate(this.parent.selectedDate);
22161
+ this.parent.headerModule.updateDateRange();
22162
+ }
22163
+ level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
22164
+ columnLevels = this.parent.resourceBase.generateResourceLevels(level);
22165
+ }
22166
+ }
21948
22167
  if (this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.lastResourceLevel.length > 0) {
21949
22168
  const resourceLevel = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
21950
22169
  const resStartHour = resourceLevel.resourceData[resourceLevel.resource.startHourField];
@@ -22084,10 +22303,10 @@ class VerticalView extends ViewBase {
22084
22303
  }
22085
22304
  const curTimeWrap = [].slice.call(this.element.querySelectorAll('.' + TIMELINE_WRAPPER_CLASS));
22086
22305
  for (let i = 0, length = currentDateIndex[0]; i < length; i++) {
22087
- curTimeWrap[i].appendChild(createElement('div', { className: PREVIOUS_TIMELINE_CLASS, styles: 'top:' + topInPx }));
22306
+ curTimeWrap[parseInt(i.toString(), 10)].appendChild(createElement('div', { className: PREVIOUS_TIMELINE_CLASS, styles: 'top:' + topInPx }));
22088
22307
  }
22089
22308
  for (const day of currentDateIndex) {
22090
- curTimeWrap[day].appendChild(createElement('div', { className: CURRENT_TIMELINE_CLASS, styles: 'top:' + topInPx }));
22309
+ curTimeWrap[parseInt(day.toString(), 10)].appendChild(createElement('div', { className: CURRENT_TIMELINE_CLASS, styles: 'top:' + topInPx }));
22091
22310
  }
22092
22311
  const currentTimeEle = createElement('div', {
22093
22312
  innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
@@ -22096,8 +22315,8 @@ class VerticalView extends ViewBase {
22096
22315
  });
22097
22316
  if (rowIndex <= timeTrs.length) {
22098
22317
  removeClass(timeCellsWrap.querySelectorAll('.' + HIDE_CHILDS_CLASS), HIDE_CHILDS_CLASS);
22099
- if (timeTrs[rowIndex]) {
22100
- addClass([timeTrs[rowIndex].lastElementChild], HIDE_CHILDS_CLASS);
22318
+ if (timeTrs[parseInt(rowIndex.toString(), 10)]) {
22319
+ addClass([timeTrs[parseInt(rowIndex.toString(), 10)].lastElementChild], HIDE_CHILDS_CLASS);
22101
22320
  }
22102
22321
  prepend([currentTimeEle], timeCellsWrap);
22103
22322
  currentTimeEle.style.top = formatUnit(currentTimeEle.offsetTop - (currentTimeEle.offsetHeight / 2));
@@ -22256,7 +22475,7 @@ class VerticalView extends ViewBase {
22256
22475
  let nth;
22257
22476
  for (let i = 0; i < rowCount; i++) {
22258
22477
  const ntr = trEle.cloneNode();
22259
- const data = { className: [(this.colLevels[i][0] && this.colLevels[i][0].className[0])], type: 'emptyCells' };
22478
+ const data = { className: [(this.colLevels[parseInt(i.toString(), 10)][0] && this.colLevels[parseInt(i.toString(), 10)][0].className[0])], type: 'emptyCells' };
22260
22479
  if (this.parent.activeViewOptions.showWeekNumber && data.className.indexOf(HEADER_CELLS_CLASS) !== -1) {
22261
22480
  data.className.push(WEEK_NUMBER_CLASS);
22262
22481
  const weekNo = this.parent.getWeekNumberContent(this.renderDates);
@@ -22298,9 +22517,9 @@ class VerticalView extends ViewBase {
22298
22517
  const lastLevel = this.colLevels[rowCount - 1];
22299
22518
  for (let i = 0; i < rowCount; i++) {
22300
22519
  const ntr = trEle.cloneNode();
22301
- const level = this.colLevels[i];
22520
+ const level = this.colLevels[parseInt(i.toString(), 10)];
22302
22521
  for (let j = 0; j < level.length; j++) {
22303
- ntr.appendChild(this.createTd(level[j]));
22522
+ ntr.appendChild(this.createTd(level[parseInt(j.toString(), 10)]));
22304
22523
  }
22305
22524
  tbl.querySelector('tbody').appendChild(ntr);
22306
22525
  }
@@ -22312,7 +22531,7 @@ class VerticalView extends ViewBase {
22312
22531
  createAllDayRow(table, tdData) {
22313
22532
  const ntr = createElement('tr', { className: ALLDAY_ROW_CLASS });
22314
22533
  for (let j = 0; j < tdData.length; j++) {
22315
- const td = extend({}, tdData[j]);
22534
+ const td = extend({}, tdData[parseInt(j.toString(), 10)]);
22316
22535
  td.className = [ALLDAY_CELLS_CLASS];
22317
22536
  td.type = 'alldayCells';
22318
22537
  const ntd = this.createTd(td);
@@ -22538,7 +22757,7 @@ class VerticalView extends ViewBase {
22538
22757
  const startDate = new Date(new Date(timeSlots[0].date.getTime()).
22539
22758
  setHours(startTime.getHours(), startTime.getMinutes(), startTime.getMilliseconds()));
22540
22759
  for (let i = 0; i < timeSlots.length; i++) {
22541
- if (timeSlots[i].date.getTime() > startDate.getTime()) {
22760
+ if (timeSlots[parseInt(i.toString(), 10)].date.getTime() > startDate.getTime()) {
22542
22761
  startTime.setHours(timeSlots[i - 1].date.getHours(), timeSlots[i - 1].date.getMinutes(), timeSlots[i - 1].date.getMilliseconds());
22543
22762
  return new Date(startTime);
22544
22763
  }
@@ -22767,7 +22986,9 @@ class Month extends ViewBase {
22767
22986
  }
22768
22987
  if (leftPanelElement) {
22769
22988
  if (this.parent.currentView === 'MonthAgenda') {
22770
- height = this.element.querySelector('.' + CONTENT_TABLE_CLASS).offsetHeight;
22989
+ height = (this.parent.activeViewOptions.interval > 1) ?
22990
+ this.getContentAreaElement().firstElementChild.offsetHeight :
22991
+ this.element.querySelector('.' + CONTENT_TABLE_CLASS).offsetHeight;
22771
22992
  }
22772
22993
  leftPanelElement.style.height = 'auto';
22773
22994
  leftPanelElement.style.height = formatUnit(height - this.getScrollXIndent(content));
@@ -22783,7 +23004,12 @@ class Month extends ViewBase {
22783
23004
  }
22784
23005
  if (this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.lastResourceLevel.length > 0) {
22785
23006
  const resourceLevel = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
22786
- colLevels = [this.getDateSlots(resourceLevel.renderDates, resourceLevel.workDays)];
23007
+ let levels = this.getDateSlots(resourceLevel.renderDates, resourceLevel.workDays);
23008
+ if (this.parent.activeViewOptions.group.byDate && this.parent.activeViewOptions.group.hideNonWorkingDays) {
23009
+ const index = levels.findIndex((x, index) => index !== 0 && x.date.getDay() === levels[0].date.getDay());
23010
+ levels = index > -1 ? levels.slice(0, index) : levels;
23011
+ }
23012
+ colLevels = [levels];
22787
23013
  }
22788
23014
  }
22789
23015
  else {
@@ -22802,7 +23028,7 @@ class Month extends ViewBase {
22802
23028
  if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
22803
23029
  classList$$1.push(CURRENT_DAY_CLASS);
22804
23030
  }
22805
- dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList$$1, colSpan: 1, workDays: workDays });
23031
+ dateSlots.push({ date: renderDates[parseInt(col.toString(), 10)], type: 'monthDay', className: classList$$1, colSpan: 1, workDays: workDays });
22806
23032
  }
22807
23033
  return dateSlots;
22808
23034
  }
@@ -22819,6 +23045,9 @@ class Month extends ViewBase {
22819
23045
  clsList.push(type);
22820
23046
  if (this.parent.activeViewOptions.group.byDate) {
22821
23047
  clsList.push('e-by-date');
23048
+ if (this.parent.currentView !== 'Month') {
23049
+ this.parent.activeViewOptions.group.hideNonWorkingDays = false;
23050
+ }
22822
23051
  }
22823
23052
  if (this.parent.activeViewOptions.allowVirtualScrolling && !this.parent.uiStateValues.isGroupAdaptive) {
22824
23053
  clsList.push(VIRTUAL_SCROLL_CLASS);
@@ -22932,10 +23161,10 @@ class Month extends ViewBase {
22932
23161
  this.createColGroup(table, this.colLevels[this.colLevels.length - 1]);
22933
23162
  const trEle = createElement('tr');
22934
23163
  for (let i = 0; i < this.colLevels.length; i++) {
22935
- const level = this.colLevels[i];
23164
+ const level = this.colLevels[parseInt(i.toString(), 10)];
22936
23165
  const ntr = trEle.cloneNode();
22937
23166
  for (let j = 0; j < level.length; j++) {
22938
- const td = level[j];
23167
+ const td = level[parseInt(j.toString(), 10)];
22939
23168
  ntr.appendChild(this.createHeaderCell(td));
22940
23169
  }
22941
23170
  table.querySelector('tbody').appendChild(ntr);
@@ -22993,10 +23222,10 @@ class Month extends ViewBase {
22993
23222
  date: new Date(+renderDate), groupIndex: resData.groupIndex, workDays: resData.workDays,
22994
23223
  type: 'monthCells', className: classList$$1 || [WORK_CELLS_CLASS]
22995
23224
  };
22996
- if (!slotDatas[rowIndex]) {
22997
- slotDatas[rowIndex] = [];
23225
+ if (!slotDatas[parseInt(rowIndex.toString(), 10)]) {
23226
+ slotDatas[parseInt(rowIndex.toString(), 10)] = [];
22998
23227
  }
22999
- slotDatas[rowIndex].push(data);
23228
+ slotDatas[parseInt(rowIndex.toString(), 10)].push(data);
23000
23229
  };
23001
23230
  const includeResource = this.parent.currentView !== 'MonthAgenda' &&
23002
23231
  this.parent.activeViewOptions.group.resources.length > 0;
@@ -23020,17 +23249,27 @@ class Month extends ViewBase {
23020
23249
  const startIndex = this.renderDates.map(Number).indexOf(+level[0].date);
23021
23250
  for (let i = 0; i < (this.renderDates.length / count); i++) {
23022
23251
  const colDates = dates.splice(0, count);
23252
+ let k = startIndex;
23023
23253
  for (let j = startIndex; j < (this.colLevels[0].length + startIndex) && j < colDates.length; j++) {
23024
- const colDate = colDates[j];
23254
+ const colDate = colDates[parseInt(k.toString(), 10)];
23255
+ k++;
23025
23256
  if (includeResource) {
23026
23257
  const lastRow = this.colLevels[(this.colLevels.length - 1)];
23027
- const resourcesTd = lastRow.slice(0, lastRow.length / count);
23258
+ const rowCount = lastRow.length / count;
23259
+ let resourcesTd = lastRow.slice(0, rowCount);
23260
+ if (this.parent.activeViewOptions.group.hideNonWorkingDays) {
23261
+ resourcesTd = lastRow.filter((x) => x.date.getDay() === colDate.getDay());
23262
+ if (resourcesTd.length === 0) {
23263
+ j = j - 1;
23264
+ continue;
23265
+ }
23266
+ }
23028
23267
  for (let resIndex = 0; resIndex < resourcesTd.length; resIndex++) {
23029
23268
  let clsList;
23030
23269
  if (resIndex !== 0) {
23031
23270
  clsList = [WORK_CELLS_CLASS, DISABLE_DATE];
23032
23271
  }
23033
- prepareSlots(i, colDate, resourcesTd[resIndex], clsList);
23272
+ prepareSlots(i, colDate, resourcesTd[parseInt(resIndex.toString(), 10)], clsList);
23034
23273
  }
23035
23274
  }
23036
23275
  else {
@@ -23079,8 +23318,8 @@ class Month extends ViewBase {
23079
23318
  const slotDatas = this.getContentSlots();
23080
23319
  for (let row = 0; row < slotDatas.length; row++) {
23081
23320
  const ntr = tr.cloneNode();
23082
- for (let col = 0; col < slotDatas[row].length; col++) {
23083
- const ntd = this.createContentTd(slotDatas[row][col], td);
23321
+ for (let col = 0; col < slotDatas[parseInt(row.toString(), 10)].length; col++) {
23322
+ const ntd = this.createContentTd(slotDatas[parseInt(row.toString(), 10)][parseInt(col.toString(), 10)], td);
23084
23323
  ntr.appendChild(ntd);
23085
23324
  }
23086
23325
  trows.push(ntr);
@@ -23385,7 +23624,7 @@ class Year extends ViewBase {
23385
23624
  renderCalendarHeader(currentDate) {
23386
23625
  const headerWrapper = createElement('div', { className: 'e-header e-month' });
23387
23626
  const headerContent = createElement('div', { className: 'e-day e-title' });
23388
- if (this.parent.monthHeaderTemplate) {
23627
+ if (this.parent.activeViewOptions.monthHeaderTemplate) {
23389
23628
  const args = { date: currentDate, type: 'monthHeader' };
23390
23629
  this.renderTemplates(this.parent.getMonthHeaderTemplate(), args, 'monthHeaderTemplate', this.parent.activeViewOptions.monthHeaderTemplateName, headerContent);
23391
23630
  }
@@ -23409,7 +23648,7 @@ class Year extends ViewBase {
23409
23648
  tr.appendChild(createElement('th'));
23410
23649
  }
23411
23650
  for (let i = 0; i < WEEK_LENGTH; i++) {
23412
- if (this.parent.dayHeaderTemplate) {
23651
+ if (this.parent.activeViewOptions.dayHeaderTemplate) {
23413
23652
  const th = createElement('th');
23414
23653
  const args = { date: currentWeek, type: 'dayHeader' };
23415
23654
  this.renderTemplates(this.parent.getDayHeaderTemplate(), args, 'dayHeaderTemplate', this.parent.activeViewOptions.dayHeaderTemplateName, th);
@@ -23467,9 +23706,14 @@ class Year extends ViewBase {
23467
23706
  addClass([td], classList$$1);
23468
23707
  }
23469
23708
  tr.appendChild(td);
23470
- EventHandler.add(td, 'click', this.onCellClick, this);
23471
- if (!this.parent.isAdaptive) {
23472
- EventHandler.add(td, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
23709
+ if (!this.parent.isMinMaxDate(date)) {
23710
+ addClass([td], DISABLE_DATES);
23711
+ }
23712
+ else {
23713
+ EventHandler.add(td, 'click', this.onCellClick, this);
23714
+ if (!this.parent.isAdaptive) {
23715
+ EventHandler.add(td, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
23716
+ }
23473
23717
  }
23474
23718
  this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
23475
23719
  }
@@ -23631,6 +23875,7 @@ class Year extends ViewBase {
23631
23875
  if (!args.isPreventScrollUpdate) {
23632
23876
  if (this.parent.uiStateValues.isInitial) {
23633
23877
  this.parent.uiStateValues.isInitial = false;
23878
+ this.parent.uiStateValues.top = this.parent.uiStateValues.left = 0;
23634
23879
  }
23635
23880
  else {
23636
23881
  if (leftPanelElement) {
@@ -23750,40 +23995,41 @@ class AgendaBase extends ViewBase {
23750
23995
  listElements.forEach((element, li) => {
23751
23996
  const appWrapper = createElement('div', {
23752
23997
  className: APPOINTMENT_CLASS, attrs: {
23753
- 'data-id': 'Appointment_' + listData[li][this.parent.eventFields.id],
23754
- 'data-guid': listData[li].Guid,
23998
+ 'data-id': 'Appointment_' + listData[parseInt(li.toString(), 10)][`${this.parent.eventFields.id}`],
23999
+ 'data-guid': listData[parseInt(li.toString(), 10)].Guid,
23755
24000
  'role': 'button',
23756
24001
  'tabindex': '0',
23757
- 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(listData[li]),
24002
+ 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(listData[parseInt(li.toString(), 10)]),
23758
24003
  'aria-pressed': 'false',
23759
- 'aria-label': this.parent.getAnnouncementString(listData[li])
24004
+ 'aria-label': this.parent.getAnnouncementString(listData[parseInt(li.toString(), 10)])
23760
24005
  }
23761
24006
  });
23762
24007
  if (!isNullOrUndefined(groupIndex)) {
23763
24008
  appWrapper.setAttribute('data-group-index', groupIndex.toString());
23764
24009
  }
23765
- this.parent.eventBase.applyResourceColor(appWrapper, listData[li], 'borderColor', groupOrder);
24010
+ this.parent.eventBase.applyResourceColor(appWrapper, listData[parseInt(li.toString(), 10)], 'borderColor', groupOrder);
23766
24011
  let templateEle;
23767
24012
  if (!isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)) {
23768
24013
  addClass([appWrapper], EVENT_TEMPLATE);
23769
24014
  const scheduleId = this.parent.element.id + '_';
23770
24015
  const viewName = this.parent.activeViewOptions.eventTemplateName;
23771
24016
  const templateId = scheduleId + viewName + 'eventTemplate';
23772
- templateEle = this.parent.getAppointmentTemplate()(listData[li], this.parent, 'eventTemplate', templateId, false);
23773
- if (!isNullOrUndefined(listData[li][fieldMapping.recurrenceRule])) {
23774
- const iconClass = (listData[li][fieldMapping.id] === listData[li][fieldMapping.recurrenceID]) ?
24017
+ templateEle = this.parent.getAppointmentTemplate()(listData[parseInt(li.toString(), 10)], this.parent, 'eventTemplate', templateId, false);
24018
+ if (!isNullOrUndefined(listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceRule])) {
24019
+ const iconClass = (listData[parseInt(li.toString(), 10)][fieldMapping.id] ===
24020
+ listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceID]) ?
23775
24021
  EVENT_RECURRENCE_ICON_CLASS : EVENT_RECURRENCE_EDIT_ICON_CLASS;
23776
24022
  appWrapper.appendChild(createElement('div', { className: ICON + ' ' + iconClass }));
23777
24023
  }
23778
24024
  }
23779
24025
  else {
23780
- templateEle = this.createAppointment(listData[li]);
24026
+ templateEle = this.createAppointment(listData[parseInt(li.toString(), 10)]);
23781
24027
  }
23782
24028
  append([].slice.call(templateEle), appWrapper);
23783
24029
  removeChildren(element);
23784
24030
  element.appendChild(appWrapper);
23785
24031
  const args = {
23786
- data: extend({}, listData[li], null, true),
24032
+ data: extend({}, listData[parseInt(li.toString(), 10)], null, true),
23787
24033
  element: element, cancel: false
23788
24034
  };
23789
24035
  this.parent.trigger(eventRendered, args, (eventArgs) => {
@@ -23882,7 +24128,7 @@ class AgendaBase extends ViewBase {
23882
24128
  const data = [];
23883
24129
  agendaDate = firstDate;
23884
24130
  // eslint-disable-next-line max-len
23885
- const resDataCollection = this.parent.eventBase.filterEvents(agendaDate, agendaLastDate, agendaCollection, resData[res]);
24131
+ const resDataCollection = this.parent.eventBase.filterEvents(agendaDate, agendaLastDate, agendaCollection, resData[parseInt(res.toString(), 10)]);
23886
24132
  if (resDataCollection.length > 0 || !this.parent.hideEmptyAgendaDays || this.parent.currentView === 'MonthAgenda') {
23887
24133
  for (let r = 0; r < noOfDays; r++) {
23888
24134
  // eslint-disable-next-line max-len
@@ -23892,19 +24138,22 @@ class AgendaBase extends ViewBase {
23892
24138
  data.push(resDayCollection[0]);
23893
24139
  eventObj = {
23894
24140
  rowSpan: 1, type: 'eventColumn', resource: resColl[resColl.length - 1],
23895
- groupIndex: resData[res].groupIndex, groupOrder: resData[res].groupOrder,
23896
- resourceData: resData[res].resourceData, eventData: resDayCollection, date: agendaDate
24141
+ groupIndex: resData[parseInt(res.toString(), 10)].groupIndex,
24142
+ groupOrder: resData[parseInt(res.toString(), 10)].groupOrder,
24143
+ resourceData: resData[parseInt(res.toString(), 10)].resourceData,
24144
+ eventData: resDayCollection, date: agendaDate
23897
24145
  };
23898
24146
  dateObj = {
23899
- rowSpan: 1, type: 'dateColumn', resource: resColl[resColl.length - 1],
23900
- groupOrder: resData[res].groupOrder, resourceData: resData[res].resourceData,
24147
+ rowSpan: 1, type: 'dateColumn', resource: resColl[parseInt((resColl.length - 1).toString(), 10)],
24148
+ groupOrder: resData[parseInt(res.toString(), 10)].groupOrder,
24149
+ resourceData: resData[parseInt(res.toString(), 10)].resourceData,
23901
24150
  date: agendaDate
23902
24151
  };
23903
- if (!lastLevelInfo[tempIndex]) {
23904
- lastLevelInfo[tempIndex] = [];
24152
+ if (!lastLevelInfo[parseInt(tempIndex.toString(), 10)]) {
24153
+ lastLevelInfo[parseInt(tempIndex.toString(), 10)] = [];
23905
24154
  }
23906
- lastLevelInfo[tempIndex].push(eventObj);
23907
- lastLevelInfo[tempIndex].push(dateObj);
24155
+ lastLevelInfo[parseInt(tempIndex.toString(), 10)].push(eventObj);
24156
+ lastLevelInfo[parseInt(tempIndex.toString(), 10)].push(dateObj);
23908
24157
  tempIndex++;
23909
24158
  }
23910
24159
  agendaDate = addDays(agendaDate, 1);
@@ -23912,12 +24161,13 @@ class AgendaBase extends ViewBase {
23912
24161
  || this.parent.currentView === 'MonthAgenda') {
23913
24162
  lastLevelInfo[lastLevelInfo.length - 1][1].cssClass = AGENDA_DAY_BORDER_CLASS;
23914
24163
  const tempObj = {
23915
- rowSpan: data.length, type: 'resourceColumn', resource: resColl[resColl.length - 1],
23916
- groupOrder: resData[res].groupOrder.slice(0, -1), resourceData: resData[res].resourceData,
24164
+ rowSpan: data.length, type: 'resourceColumn', resource: resColl[parseInt((resColl.length - 1).toString(), 10)],
24165
+ groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
24166
+ resourceData: resData[parseInt(res.toString(), 10)].resourceData,
23917
24167
  groupIndex: (lastLevelInfo.length - data.length), className: [RESOURCE_NAME],
23918
24168
  date: agendaDate
23919
24169
  };
23920
- lastLevelInfo[lastLevelInfo.length - data.length].push(tempObj);
24170
+ lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
23921
24171
  tempLastLevelInfo.push(extend({}, tempObj, null, true));
23922
24172
  break;
23923
24173
  }
@@ -23933,15 +24183,15 @@ class AgendaBase extends ViewBase {
23933
24183
  let z = 0;
23934
24184
  for (let u = 0; u < tempLastLevelInfo.length; u++) {
23935
24185
  // eslint-disable-next-line max-len
23936
- if (tempLastLevelInfo[u].groupOrder[topResources.length - (y + 1)] === data[x][topResources[topResources.length - (y + 1)].idField]) {
23937
- totalRowSpan = totalRowSpan + tempLastLevelInfo[u].rowSpan;
23938
- tempGroupedData.push(extend({}, tempLastLevelInfo[u], null, true));
24186
+ if (tempLastLevelInfo[parseInt(u.toString(), 10)].groupOrder[topResources.length - (y + 1)] === data[parseInt(x.toString(), 10)][topResources[topResources.length - (y + 1)].idField]) {
24187
+ totalRowSpan = totalRowSpan + tempLastLevelInfo[parseInt(u.toString(), 10)].rowSpan;
24188
+ tempGroupedData.push(extend({}, tempLastLevelInfo[parseInt(u.toString(), 10)], null, true));
23939
24189
  }
23940
24190
  if (++z === tempLastLevelInfo.length && tempGroupedData.length > 0) {
23941
24191
  tempGroupedData[0].rowSpan = totalRowSpan;
23942
24192
  tempGroupedData[0].type = 'parentColumnLevel_' + (y + 1);
23943
24193
  tempGroupedData[0].resource = topResources[topResources.length - (y + 1)];
23944
- tempGroupedData[0].resourceData = data[x];
24194
+ tempGroupedData[0].resourceData = data[parseInt(x.toString(), 10)];
23945
24195
  tempGroupedData[0].date = agendaDate;
23946
24196
  lastLevelInfo[tempGroupedData[0].groupIndex].push(tempGroupedData[0]);
23947
24197
  tempGroupedData = [];
@@ -23969,22 +24219,22 @@ class AgendaBase extends ViewBase {
23969
24219
  let tContentCollection = [];
23970
24220
  const parentCollection = this.parent.resourceBase.resourceCollection.slice(0, -1);
23971
24221
  for (let w = 0; w < tContent.length; w++) {
23972
- tContentCollection = tContentCollection.concat(tContent[w]);
24222
+ tContentCollection = tContentCollection.concat(tContent[parseInt(w.toString(), 10)]);
23973
24223
  }
23974
24224
  level = (parentCollection.length > 0) ? 'parentColumnLevel_' + parentCollection.length : 'resourceColumn';
23975
24225
  const rowSpanCollection = tContentCollection.filter((data) => data.type === level);
23976
24226
  for (let x = 0; x < rowSpanCollection.length; x++) {
23977
- rowSpan = rowSpan + rowSpanCollection[x].rowSpan;
24227
+ rowSpan = rowSpan + rowSpanCollection[parseInt(x.toString(), 10)].rowSpan;
23978
24228
  }
23979
24229
  }
23980
24230
  for (let row = 0; row < tContent.length; row++) {
23981
24231
  ntr = tr.cloneNode();
23982
- for (let col = tContent[row].length - 1; col >= 0; col--) {
23983
- const data = tContent[row][col];
24232
+ for (let col = tContent[parseInt(row.toString(), 10)].length - 1; col >= 0; col--) {
24233
+ const data = tContent[parseInt(row.toString(), 10)][parseInt(col.toString(), 10)];
23984
24234
  let ntd = td.cloneNode();
23985
24235
  if (data.type === 'dateColumn') {
23986
24236
  if (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') {
23987
- tempData = tContent[row][col];
24237
+ tempData = tContent[parseInt(row.toString(), 10)][parseInt(col.toString(), 10)];
23988
24238
  continue;
23989
24239
  }
23990
24240
  ntd.setAttribute('data-date', data.date.getTime().toString());
@@ -24219,7 +24469,7 @@ class Agenda extends AgendaBase {
24219
24469
  this.parent.activeViewOptions.allowVirtualScrolling = false;
24220
24470
  date = firstDate;
24221
24471
  if (this.parent.headerModule) {
24222
- this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());
24472
+ this.parent.headerModule.updateDateRange();
24223
24473
  this.parent.headerModule.updateHeaderItems('remove');
24224
24474
  }
24225
24475
  }
@@ -24293,8 +24543,8 @@ class Agenda extends AgendaBase {
24293
24543
  prepend([].slice.call(emptyTBody.childNodes), tBody);
24294
24544
  this.wireEventActions();
24295
24545
  for (let s = 0, element = tBody.children; s < element.length; s++) {
24296
- if (element[s].getAttribute('data-row-index') === topElement.getAttribute('data-column-index')) {
24297
- const scrollToValue = element[s].offsetTop -
24546
+ if (element[parseInt(s.toString(), 10)].getAttribute('data-row-index') === topElement.getAttribute('data-column-index')) {
24547
+ const scrollToValue = element[parseInt(s.toString(), 10)].offsetTop -
24298
24548
  this.element.querySelector('.e-agenda-item').offsetHeight;
24299
24549
  target.scrollTop = scrollToValue;
24300
24550
  break;
@@ -24343,7 +24593,7 @@ class Agenda extends AgendaBase {
24343
24593
  }
24344
24594
  else {
24345
24595
  for (let a = 0, length = liCollection.length; a < length; a++) {
24346
- li = liCollection[a];
24596
+ li = liCollection[parseInt(a.toString(), 10)];
24347
24597
  liDetails = li.getBoundingClientRect();
24348
24598
  if (liDetails.top >= 0) {
24349
24599
  filterElement = closest(li, '.' + AGENDA_CELLS_CLASS);
@@ -24356,7 +24606,7 @@ class Agenda extends AgendaBase {
24356
24606
  }
24357
24607
  updateHeaderText(date) {
24358
24608
  if (this.parent.showHeaderBar) {
24359
- this.parent.headerModule.updateDateRange(this.getDateRangeText(date));
24609
+ this.parent.headerModule.updateDateRange(date);
24360
24610
  }
24361
24611
  }
24362
24612
  getPreviousNextDate(date, type) {
@@ -24557,11 +24807,18 @@ class MonthAgenda extends Month {
24557
24807
  }
24558
24808
  const contentArea = this.getContentAreaElement().firstElementChild;
24559
24809
  const dateHeader = this.element.querySelector('.' + DATE_HEADER_WRAP_CLASS);
24560
- const availHeight = this.parent.element.offsetHeight - headerHeight - dateHeader.offsetHeight - contentArea.offsetHeight;
24810
+ const availHeight = this.parent.element.offsetHeight - headerHeight - dateHeader.offsetHeight;
24811
+ const contentAreaHeight = (this.parent.activeViewOptions.interval > 1) ?
24812
+ Math.round(availHeight * 0.8) : contentArea.offsetHeight;
24813
+ const appContainerHeight = availHeight - contentAreaHeight;
24561
24814
  const wrapperContainer = this.element.querySelector('.' + WRAPPER_CONTAINER_CLASS);
24562
24815
  const eventWrapper = this.element.querySelector('.' + APPOINTMENT_WRAP_CLASS);
24563
24816
  if (this.parent.height !== 'auto') {
24564
- wrapperContainer.style.height = eventWrapper.style.height = formatUnit(availHeight);
24817
+ if (this.parent.activeViewOptions.interval > 1) {
24818
+ contentArea.style.height = formatUnit(contentAreaHeight);
24819
+ EventHandler.add(contentArea, 'scroll', this.onContentScroll, this);
24820
+ }
24821
+ wrapperContainer.style.height = eventWrapper.style.height = formatUnit(appContainerHeight);
24565
24822
  }
24566
24823
  }
24567
24824
  onDataReady(args) {
@@ -24577,7 +24834,7 @@ class MonthAgenda extends Month {
24577
24834
  let count = 0;
24578
24835
  for (const date of this.renderDates) {
24579
24836
  const filterData = this.appointmentFiltering(date);
24580
- const workCell = this.element.querySelectorAll('.' + WORK_CELLS_CLASS)[count];
24837
+ const workCell = this.element.querySelectorAll('.' + WORK_CELLS_CLASS)[parseInt(count.toString(), 10)];
24581
24838
  if (filterData.length > 0) {
24582
24839
  if (!workCell.querySelector('.' + APPOINTMENT_INDICATOR_CLASS)) {
24583
24840
  workCell.appendChild(createElement('div', { className: APPOINTMENT_INDICATOR_CLASS }));
@@ -24679,8 +24936,8 @@ class TimelineHeaderRow {
24679
24936
  const result = {};
24680
24937
  for (const d of dates) {
24681
24938
  const key = d.getFullYear();
24682
- result[key] = result[key] || [];
24683
- result[key].push(d);
24939
+ result[parseInt(key.toString(), 10)] = result[parseInt(key.toString(), 10)] || [];
24940
+ result[parseInt(key.toString(), 10)].push(d);
24684
24941
  }
24685
24942
  return result;
24686
24943
  }
@@ -24688,8 +24945,8 @@ class TimelineHeaderRow {
24688
24945
  const result = {};
24689
24946
  for (const d of dates) {
24690
24947
  const key = (d.getFullYear() - 1970) * 12 + d.getMonth();
24691
- result[key] = result[key] || [];
24692
- result[key].push(d);
24948
+ result[parseInt(key.toString(), 10)] = result[parseInt(key.toString(), 10)] || [];
24949
+ result[parseInt(key.toString(), 10)].push(d);
24693
24950
  }
24694
24951
  return result;
24695
24952
  }
@@ -24702,8 +24959,8 @@ class TimelineHeaderRow {
24702
24959
  if (this.parent.firstDayOfWeek && this.parent.firstDayOfWeek > new Date(+d).getDay()) {
24703
24960
  key = key - 1;
24704
24961
  }
24705
- result[key] = result[key] || [];
24706
- result[key].push(d);
24962
+ result[parseInt(key.toString(), 10)] = result[parseInt(key.toString(), 10)] || [];
24963
+ result[parseInt(key.toString(), 10)].push(d);
24707
24964
  }
24708
24965
  return result;
24709
24966
  }
@@ -24712,7 +24969,7 @@ class TimelineHeaderRow {
24712
24969
  const tdDatas = [];
24713
24970
  const keys = Object.keys(data);
24714
24971
  for (let i = 0; i < keys.length; i++) {
24715
- const dates = data[keys[i]];
24972
+ const dates = data[keys[parseInt(i.toString(), 10)]];
24716
24973
  let htmlCol;
24717
24974
  if (row.template) {
24718
24975
  const args = { date: dates[0], type: type };
@@ -24974,7 +25231,7 @@ class TimelineViews extends VerticalView {
24974
25231
  return 1;
24975
25232
  }
24976
25233
  getResourceTdData(i, tdData) {
24977
- const resLevel = this.parent.resourceBase.renderedResources[i];
25234
+ const resLevel = this.parent.resourceBase.renderedResources[parseInt(i.toString(), 10)];
24978
25235
  const resSHr = resLevel.resourceData[resLevel.resource.startHourField] || this.parent.workHours.start;
24979
25236
  const resEHr = resLevel.resourceData[resLevel.resource.endHourField] || this.parent.workHours.end;
24980
25237
  tdData.startHour = this.parent.getStartEndTime(resSHr);
@@ -25023,7 +25280,7 @@ class TimelineViews extends VerticalView {
25023
25280
  else {
25024
25281
  const timeSlots = this.colLevels[this.colLevels.length - 1];
25025
25282
  for (let i = 0; i < timeSlots.length; i++) {
25026
- if (timeSlots[i].date.getTime() > date.getTime()) {
25283
+ if (timeSlots[parseInt(i.toString(), 10)].date.getTime() > date.getTime()) {
25027
25284
  return timeSlots[i - 1].date;
25028
25285
  }
25029
25286
  }
@@ -25121,7 +25378,7 @@ class TimelineMonth extends Month {
25121
25378
  for (const data of this.colLevels[this.colLevels.length - 1]) {
25122
25379
  data.className = [WORK_CELLS_CLASS];
25123
25380
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25124
- const resLevel = this.parent.resourceBase.renderedResources[row];
25381
+ const resLevel = this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)];
25125
25382
  data.workDays = resLevel.resourceData[resLevel.resource.workDaysField] || this.parent.workDays;
25126
25383
  data.className = data.className.concat(resLevel.className);
25127
25384
  data.groupIndex = resLevel.groupIndex;
@@ -25131,10 +25388,10 @@ class TimelineMonth extends Month {
25131
25388
  date: new Date(+data.date), colSpan: data.colSpan, groupIndex: data.groupIndex, workDays: data.workDays,
25132
25389
  type: 'monthCells', className: data.className
25133
25390
  };
25134
- if (!slotDatas[row]) {
25135
- slotDatas[row] = [];
25391
+ if (!slotDatas[parseInt(row.toString(), 10)]) {
25392
+ slotDatas[parseInt(row.toString(), 10)] = [];
25136
25393
  }
25137
- slotDatas[row].push(slotData);
25394
+ slotDatas[parseInt(row.toString(), 10)].push(slotData);
25138
25395
  }
25139
25396
  }
25140
25397
  return slotDatas;
@@ -25173,7 +25430,7 @@ class TimelineMonth extends Month {
25173
25430
  getAdjustedDate(startTime) {
25174
25431
  const timeSlots = this.colLevels[this.colLevels.length - 1];
25175
25432
  for (let i = 0; i < timeSlots.length; i++) {
25176
- if (timeSlots[i].date.getTime() > startTime.getTime()) {
25433
+ if (timeSlots[parseInt(i.toString(), 10)].date.getTime() > startTime.getTime()) {
25177
25434
  return timeSlots[i - 1].date;
25178
25435
  }
25179
25436
  }
@@ -25245,11 +25502,11 @@ class TimelineYear extends Year {
25245
25502
  const months = this.getMonths();
25246
25503
  const dayHeaderDates = this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(), months[0], 1));
25247
25504
  for (let column = 0; column < this.columnCount; column++) {
25248
- const date = new Date(this.parent.selectedDate.getFullYear(), months[column], 1);
25505
+ const date = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(column.toString(), 10)], 1);
25249
25506
  const innerTd = createElement('td', { className: HEADER_CELLS_CLASS });
25250
25507
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
25251
25508
  if (this.parent.dayHeaderTemplate) {
25252
- append(this.renderDayMonthHeaderTemplate(dayHeaderDates[column], column, 'dayHeaderTemplate'), innerTd);
25509
+ append(this.renderDayMonthHeaderTemplate(dayHeaderDates[parseInt(column.toString(), 10)], column, 'dayHeaderTemplate'), innerTd);
25253
25510
  }
25254
25511
  else {
25255
25512
  innerTd.innerHTML = `<span>${this.parent.getDayNames('abbreviated')[column % 7]}</span>`;
@@ -25257,7 +25514,7 @@ class TimelineYear extends Year {
25257
25514
  }
25258
25515
  else {
25259
25516
  if (this.parent.monthHeaderTemplate) {
25260
- append(this.renderDayMonthHeaderTemplate(date, months[column], 'monthHeaderTemplate'), innerTd);
25517
+ append(this.renderDayMonthHeaderTemplate(date, months[parseInt(column.toString(), 10)], 'monthHeaderTemplate'), innerTd);
25261
25518
  }
25262
25519
  else {
25263
25520
  innerTd.innerHTML = `<span>${this.getMonthName(date)}</span>`;
@@ -25371,7 +25628,7 @@ class TimelineYear extends Year {
25371
25628
  const dayHeaderDates = this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(), months[0], 1));
25372
25629
  for (let month = 0; month < this.rowCount; month++) {
25373
25630
  wrapper.appendChild(createElement('div', { className: APPOINTMENT_CONTAINER_CLASS }));
25374
- let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
25631
+ let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(month.toString(), 10)], 1);
25375
25632
  let monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25376
25633
  let monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
25377
25634
  const tr = createElement('tr');
@@ -25391,7 +25648,7 @@ class TimelineYear extends Year {
25391
25648
  }
25392
25649
  else {
25393
25650
  if (this.parent.dayHeaderTemplate) {
25394
- append(this.renderDayMonthHeaderTemplate(dayHeaderDates[month], month, 'dayHeaderTemplate'), monthTd);
25651
+ append(this.renderDayMonthHeaderTemplate(dayHeaderDates[parseInt(month.toString(), 10)], month, 'dayHeaderTemplate'), monthTd);
25395
25652
  }
25396
25653
  else {
25397
25654
  monthTd.innerHTML = `<span>${this.parent.getDayNames('abbreviated')[month % 7]}</span>`;
@@ -25403,11 +25660,11 @@ class TimelineYear extends Year {
25403
25660
  for (let column = 0; column < this.columnCount; column++) {
25404
25661
  let isDateAvail;
25405
25662
  if (this.parent.activeViewOptions.orientation === 'Vertical') {
25406
- monthDate = new Date(this.parent.selectedDate.getFullYear(), months[column], 1);
25663
+ monthDate = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(column.toString(), 10)], 1);
25407
25664
  monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25408
25665
  monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
25409
25666
  const dayDate = (month - monthStart.getDay()) + 1;
25410
- date = new Date(this.parent.selectedDate.getFullYear(), months[column], dayDate);
25667
+ date = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(column.toString(), 10)], dayDate);
25411
25668
  isDateAvail = dayDate > 0 && date.getTime() < monthEnd.getTime();
25412
25669
  }
25413
25670
  else {
@@ -25433,6 +25690,9 @@ class TimelineYear extends Year {
25433
25690
  if (this.parent.activeViewOptions.workDays.indexOf(date.getDay()) > -1) {
25434
25691
  classList$$1.push(WORKDAY_CLASS);
25435
25692
  }
25693
+ if (!this.parent.isMinMaxDate(date)) {
25694
+ addClass([td], DISABLE_DATES);
25695
+ }
25436
25696
  if (this.isCurrentDate(date)) {
25437
25697
  classList$$1.push(CURRENT_DAY_CLASS);
25438
25698
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
@@ -25448,6 +25708,9 @@ class TimelineYear extends Year {
25448
25708
  }
25449
25709
  else {
25450
25710
  addClass([td], OTHERMONTH_CLASS);
25711
+ if (!this.parent.isMinMaxDate(date)) {
25712
+ addClass([td], DISABLE_DATES);
25713
+ }
25451
25714
  }
25452
25715
  if (td.classList.contains(OTHERMONTH_CLASS)) {
25453
25716
  continue;
@@ -25475,9 +25738,9 @@ class TimelineYear extends Year {
25475
25738
  tRow.push(tr);
25476
25739
  let resData;
25477
25740
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25478
- resData = this.parent.resourceBase.renderedResources[row];
25741
+ resData = this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)];
25479
25742
  }
25480
- let monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[row], 1);
25743
+ let monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[parseInt(row.toString(), 10)], 1);
25481
25744
  let date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25482
25745
  for (let month = 0; month < this.columnCount; month++) {
25483
25746
  let classList$$1 = [];
@@ -25489,7 +25752,7 @@ class TimelineYear extends Year {
25489
25752
  else {
25490
25753
  classList$$1.push(WORKDAY_CLASS);
25491
25754
  }
25492
- monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[month], 1);
25755
+ monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[parseInt(month.toString(), 10)], 1);
25493
25756
  date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25494
25757
  const tdELe = createElement('td', {
25495
25758
  className: WORK_CELLS_CLASS,
@@ -25516,9 +25779,9 @@ class TimelineYear extends Year {
25516
25779
  contentBody.appendChild(tr);
25517
25780
  let resData;
25518
25781
  if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25519
- resData = this.parent.resourceBase.renderedResources[row];
25782
+ resData = this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)];
25520
25783
  }
25521
- let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[row], 1);
25784
+ let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(row.toString(), 10)], 1);
25522
25785
  let date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25523
25786
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
25524
25787
  const monthTr = tr.cloneNode();
@@ -25547,11 +25810,11 @@ class TimelineYear extends Year {
25547
25810
  else {
25548
25811
  classList$$1.push(WORKDAY_CLASS);
25549
25812
  }
25550
- monthDate = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
25813
+ monthDate = new Date(this.parent.selectedDate.getFullYear(), months[parseInt(month.toString(), 10)], 1);
25551
25814
  date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25552
25815
  }
25553
25816
  else {
25554
- groupIndex = this.colLevels.slice(-1)[0][month].groupIndex;
25817
+ groupIndex = this.colLevels.slice(-1)[0][parseInt(month.toString(), 10)].groupIndex;
25555
25818
  classList$$1.push(WORKDAY_CLASS);
25556
25819
  }
25557
25820
  const td = createElement('td', {
@@ -25707,7 +25970,7 @@ class ICalendarExport {
25707
25970
  const exDate = eventObj[fields.recurrenceException].split(',');
25708
25971
  for (let i = 0; i < exDate.length - 1; i++) {
25709
25972
  calendarEvent.splice(5, 0, 'EXDATE:' +
25710
- this.convertDateToString(getDateFromRecurrenceDateString(exDate[i]), eventObj[fields.isAllDay]));
25973
+ this.convertDateToString(getDateFromRecurrenceDateString(exDate[parseInt(i.toString(), 10)]), eventObj[fields.isAllDay]));
25711
25974
  }
25712
25975
  }
25713
25976
  if (eventObj[fields.recurrenceID]) {
@@ -25716,7 +25979,7 @@ class ICalendarExport {
25716
25979
  }
25717
25980
  const customFields = this.customFieldFilter(eventObj, fields);
25718
25981
  if (customFields.length > 0) {
25719
- customFields.forEach((customField) => calendarEvent.splice(4, 0, customField + ':' + (eventObj[customField] || '')));
25982
+ customFields.forEach((customField) => calendarEvent.splice(4, 0, customField + ':' + (eventObj[`${customField}`] || '')));
25720
25983
  }
25721
25984
  const app = extend({}, eventObj);
25722
25985
  app.UID = uId;
@@ -25736,7 +25999,7 @@ class ICalendarExport {
25736
25999
  return icsString;
25737
26000
  }
25738
26001
  customFieldFilter(eventObj, fields) {
25739
- const defaultFields = Object.keys(fields).map((key) => fields[key]);
26002
+ const defaultFields = Object.keys(fields).map((key) => fields[`${key}`]);
25740
26003
  const eventFields = Object.keys(eventObj);
25741
26004
  return eventFields.filter((value) => (defaultFields.indexOf(value) === -1) && (value !== 'Guid'));
25742
26005
  }
@@ -25770,7 +26033,7 @@ class ICalendarExport {
25770
26033
  }
25771
26034
  }
25772
26035
  filterEvents(data, field, value) {
25773
- return data.filter((e) => e[field] === value);
26036
+ return data.filter((e) => e[`${field}`] === value);
25774
26037
  }
25775
26038
  getModuleName() {
25776
26039
  return 'iCalendarExport';
@@ -25858,7 +26121,7 @@ class ICalendarImport {
25858
26121
  case 'BEGIN':
25859
26122
  break;
25860
26123
  case 'UID':
25861
- curEvent[uId] = value;
26124
+ curEvent[`${uId}`] = value;
25862
26125
  if (typeof (id) == 'number') {
25863
26126
  curEvent[fields.id] = parseInt(value, 10);
25864
26127
  if (isNaN(curEvent[fields.id])) {
@@ -25888,10 +26151,10 @@ class ICalendarImport {
25888
26151
  default:
25889
26152
  if (this.parent.resourceCollection.length > 0) {
25890
26153
  const resData = this.parent.resourceCollection.filter((data) => data.field === type);
25891
- curEvent[type] = (resData.length > 0 && (typeof (resData[0].dataSource[0][resData[0].idField]) == 'number')) ? parseInt(value, 10) : value;
26154
+ curEvent[`${type}`] = (resData.length > 0 && (typeof (resData[0].dataSource[0][resData[0].idField]) == 'number')) ? parseInt(value, 10) : value;
25892
26155
  }
25893
26156
  else {
25894
- curEvent[type] = value;
26157
+ curEvent[`${type}`] = value;
25895
26158
  }
25896
26159
  }
25897
26160
  }
@@ -25917,29 +26180,29 @@ class ICalendarImport {
25917
26180
  id = eventObj[fields.id];
25918
26181
  }
25919
26182
  if (appointmentIds.indexOf(eventObj[fields.id]) < 0) {
25920
- const data = app.filter((data) => data.UID === eventObj[uId]);
26183
+ const data = app.filter((data) => data.UID === eventObj[`${uId}`]);
25921
26184
  if (data.length > 1 && isNullOrUndefined(eventObj[fields.recurrenceID])) {
25922
26185
  id = typeof (maxId) === 'number' ? maxId++ : id;
25923
26186
  for (let i = 0; i < data.length; i++) {
25924
26187
  // eslint-disable-next-line no-prototype-builtins
25925
- if (data[i].hasOwnProperty(fields.recurrenceID)) {
25926
- const exdate = data[i][fields.recurrenceID];
25927
- data[i][fields.id] = typeof (maxId) === 'number' ? maxId++ : this.parent.eventBase.generateGuid();
25928
- data[i][fields.recurrenceID] = id;
25929
- data[i][fields.recurrenceException] = null;
26188
+ if (data[parseInt(i.toString(), 10)].hasOwnProperty(fields.recurrenceID)) {
26189
+ const exdate = data[parseInt(i.toString(), 10)][fields.recurrenceID];
26190
+ data[parseInt(i.toString(), 10)][fields.id] = typeof (maxId) === 'number' ? maxId++ : this.parent.eventBase.generateGuid();
26191
+ data[parseInt(i.toString(), 10)][fields.recurrenceID] = id;
26192
+ data[parseInt(i.toString(), 10)][fields.recurrenceException] = null;
25930
26193
  parentObj[fields.recurrenceException] =
25931
26194
  this.getExcludeDateString(parentObj[fields.recurrenceException], exdate);
25932
- delete data[i][uId];
25933
- appoint.push(data[i]);
26195
+ delete data[parseInt(i.toString(), 10)][`${uId}`];
26196
+ appoint.push(data[parseInt(i.toString(), 10)]);
25934
26197
  }
25935
26198
  }
25936
- delete parentObj[uId];
26199
+ delete parentObj[`${uId}`];
25937
26200
  parentObj[fields.id] = id;
25938
26201
  appoint.push(parentObj);
25939
26202
  // eslint-disable-next-line no-prototype-builtins
25940
26203
  }
25941
26204
  else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
25942
- delete eventObj[uId];
26205
+ delete eventObj[`${uId}`];
25943
26206
  eventObj[fields.id] = typeof (maxId) === 'number' ? maxId++ : id;
25944
26207
  appoint.push(eventObj);
25945
26208
  }
@@ -25968,8 +26231,7 @@ class ICalendarImport {
25968
26231
  return (value.replace(/\\\,/g, ',').replace(/\\\;/g, ';').replace(/\\[nN]/g, '\n').replace(/\\\\/g, '\\'));
25969
26232
  }
25970
26233
  dateParsing(element) {
25971
- const expression = /([^':;]+)((?:;(?:[^':;]+)(?:=(?:(?:'[^']*')|(?:[^':;]+))))*):(.*)/;
25972
- const split = (element.match(expression)).slice(1);
26234
+ const split = element.split(':');
25973
26235
  const value = split[split.length - 1];
25974
26236
  let newDate = new Date(this.getDateString(value));
25975
26237
  if (element && (element.indexOf('VALUE=DATE') > -1 || element.indexOf('RECURRENCE-ID;TZID') > -1)) {
@@ -26056,7 +26318,7 @@ class ExcelExport {
26056
26318
  getExportColumns(exportOptions) {
26057
26319
  const exportColumns = exportOptions.fieldsInfo || [];
26058
26320
  if (exportColumns.length === 0) {
26059
- const fields = exportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
26321
+ const fields = exportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[`${field}`]);
26060
26322
  fields.forEach((field) => { exportColumns.push({ name: field, text: field }); });
26061
26323
  }
26062
26324
  return exportColumns;