@syncfusion/ej2-gantt 21.1.38 → 21.2.3

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 (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +67 -24
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +68 -24
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +20 -23
  13. package/src/gantt/actions/context-menu.js +1 -1
  14. package/src/gantt/actions/dependency.js +1 -1
  15. package/src/gantt/actions/dialog-edit.js +1 -0
  16. package/src/gantt/actions/edit.js +8 -2
  17. package/src/gantt/actions/taskbar-edit.d.ts +1 -1
  18. package/src/gantt/actions/taskbar-edit.js +2 -2
  19. package/src/gantt/base/date-processor.js +2 -2
  20. package/src/gantt/base/gantt.d.ts +1 -0
  21. package/src/gantt/base/gantt.js +3 -1
  22. package/src/gantt/base/task-processor.d.ts +1 -1
  23. package/src/gantt/base/task-processor.js +31 -6
  24. package/src/gantt/renderer/chart-rows.js +16 -8
  25. package/src/gantt/renderer/nonworking-day.js +3 -1
  26. package/styles/bootstrap-dark.css +4 -0
  27. package/styles/bootstrap.css +4 -0
  28. package/styles/bootstrap4.css +4 -0
  29. package/styles/bootstrap5-dark.css +4 -0
  30. package/styles/bootstrap5.css +4 -0
  31. package/styles/fabric-dark.css +4 -0
  32. package/styles/fabric.css +4 -0
  33. package/styles/fluent-dark.css +3 -3
  34. package/styles/fluent.css +3 -3
  35. package/styles/gantt/_layout.scss +0 -8
  36. package/styles/gantt/_theme.scss +4 -0
  37. package/styles/gantt/bootstrap-dark.css +4 -0
  38. package/styles/gantt/bootstrap.css +4 -0
  39. package/styles/gantt/bootstrap4.css +4 -0
  40. package/styles/gantt/bootstrap5-dark.css +4 -0
  41. package/styles/gantt/bootstrap5.css +4 -0
  42. package/styles/gantt/fabric-dark.css +4 -0
  43. package/styles/gantt/fabric.css +4 -0
  44. package/styles/gantt/fluent-dark.css +3 -3
  45. package/styles/gantt/fluent.css +3 -3
  46. package/styles/gantt/highcontrast-light.css +4 -0
  47. package/styles/gantt/highcontrast.css +4 -0
  48. package/styles/gantt/material-dark.css +4 -0
  49. package/styles/gantt/material.css +4 -0
  50. package/styles/gantt/tailwind-dark.css +4 -0
  51. package/styles/gantt/tailwind.css +4 -0
  52. package/styles/highcontrast-light.css +4 -0
  53. package/styles/highcontrast.css +4 -0
  54. package/styles/material-dark.css +4 -0
  55. package/styles/material.css +4 -0
  56. package/styles/tailwind-dark.css +4 -0
  57. package/styles/tailwind.css +4 -0
@@ -603,10 +603,10 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
603
603
  */
604
604
  DateProcessor.prototype.getDurationAsSeconds = function (duration, durationUnit) {
605
605
  var value = 0;
606
- if (!durationUnit || durationUnit === 'day') {
606
+ if (!durationUnit || durationUnit.toLocaleLowerCase() === 'day') {
607
607
  value = this.parent.secondsPerDay * duration;
608
608
  }
609
- else if (durationUnit === 'hour') {
609
+ else if (durationUnit.toLocaleLowerCase() === 'hour') {
610
610
  value = duration * 3600;
611
611
  }
612
612
  else {
@@ -1782,6 +1782,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1782
1782
  */
1783
1783
  TaskProcessor.prototype.prepareDataSource = function (data) {
1784
1784
  this.prepareRecordCollection(data, 0);
1785
+ this.parent.initialLoadData = extend({}, {}, this.parent.flatData, true);
1785
1786
  // Method to maintain the shared task uniqueIds
1786
1787
  if (this.parent.viewType === 'ResourceView') {
1787
1788
  this.calculateSharedTaskUniqueIds();
@@ -2610,7 +2611,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2610
2611
  return 0;
2611
2612
  }
2612
2613
  else {
2613
- return this.getTaskWidth(sDate, eDate);
2614
+ return this.getTaskWidth(sDate, eDate, ganttProp);
2614
2615
  }
2615
2616
  };
2616
2617
  TaskProcessor.prototype.getTaskbarHeight = function () {
@@ -2724,13 +2725,29 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2724
2725
  * @returns {number} .
2725
2726
  * @private
2726
2727
  */
2727
- TaskProcessor.prototype.getTaskWidth = function (startDate, endDate) {
2728
+ TaskProcessor.prototype.getTaskWidth = function (startDate, endDate, ganttData) {
2728
2729
  var sDate = new Date(startDate.getTime());
2729
2730
  var eDate = new Date(endDate.getTime());
2730
2731
  var tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.bottomTier :
2731
2732
  this.parent.timelineModule.topTier;
2733
+ var isValid = false;
2734
+ var modifiedsDate = new Date(startDate.getTime());
2735
+ var hour = 0;
2736
+ if (ganttData && ganttData.durationUnit == 'hour') {
2737
+ modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 1000);
2738
+ }
2739
+ if (ganttData && ganttData.durationUnit == 'minute') {
2740
+ modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 60 * 1000);
2741
+ }
2742
+ for (var i = 0; i < this.parent.dayWorkingTime.length; i++) {
2743
+ hour = hour + this.parent.dayWorkingTime[i].to - this.parent.dayWorkingTime[i].from;
2744
+ }
2745
+ var dateDiff = modifiedsDate.getTime() - sDate.getTime();
2732
2746
  if (tierMode === 'Day') {
2733
- if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime) {
2747
+ if ((Math.floor((dateDiff / (1000 * 60 * 60)) % 24) >= hour || dateDiff === 0)) {
2748
+ isValid = true;
2749
+ }
2750
+ if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime && isValid) {
2734
2751
  sDate.setHours(0, 0, 0, 0);
2735
2752
  }
2736
2753
  if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
@@ -2740,11 +2757,19 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2740
2757
  eDate.setHours(0, 0, 0, 0);
2741
2758
  }
2742
2759
  }
2760
+ else {
2761
+ isValid = true;
2762
+ }
2743
2763
  if ((sDate).getTime() === (eDate).getTime()) {
2744
2764
  return (this.parent.perDayWidth);
2745
2765
  }
2746
2766
  else {
2747
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2767
+ if (isValid) {
2768
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2769
+ }
2770
+ else {
2771
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
2772
+ }
2748
2773
  }
2749
2774
  };
2750
2775
  /**
@@ -3893,13 +3918,13 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3893
3918
  minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3894
3919
  if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3895
3920
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3896
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3921
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone && (parentData.hasChildRecords && parentData.ganttProperties.isAutoSchedule && this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action !== "TaskbarEditing")) {
3897
3922
  this.parent.setRecordValue('startDate', minStartDate, parentData.ganttProperties, true);
3898
3923
  }
3899
3924
  }
3900
3925
  if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3901
3926
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3902
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3927
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone && (parentData.hasChildRecords && parentData.ganttProperties.isAutoSchedule && this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action !== "TaskbarEditing")) {
3903
3928
  this.parent.setRecordValue('endDate', maxEndDate, parentData.ganttProperties, true);
3904
3929
  }
3905
3930
  }
@@ -9751,7 +9776,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9751
9776
  '<div class="' + manualParentMilestoneBottom + '" style="top:' +
9752
9777
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
9753
9778
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
9754
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
9779
+ return this.createDivElement(data.ganttProperties.duration !== 0 ? template : milestoneTemplate);
9755
9780
  };
9756
9781
  /**
9757
9782
  * To get parent taskbar node.
@@ -9947,7 +9972,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9947
9972
  var template = '<div class="' + taskBarMainContainer + ' ' +
9948
9973
  this.parent.getUnscheduledTaskClass(data.ganttProperties) + ' ' +
9949
9974
  ((data.ganttProperties.cssClass) ? data.ganttProperties.cssClass : '') + '" ' +
9950
- ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent) ?
9975
+ ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent && !(data.hasChildRecords && !data.ganttProperties.isAutoSchedule)) ?
9951
9976
  ('width:' + this.milestoneHeight + 'px;height:' +
9952
9977
  this.milestoneHeight + 'px;margin-top:' + this.milestoneMarginTop + 'px;' + (this.parent.enableRtl ? 'right:' : 'left:') + (data.ganttProperties.left -
9953
9978
  (this.milestoneHeight / 2)) + 'px;') : ('width:' + data.ganttProperties.width +
@@ -10242,6 +10267,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10242
10267
  * @private
10243
10268
  */
10244
10269
  ChartRows.prototype.createTaskbarTemplate = function () {
10270
+ var _a;
10245
10271
  var trs = [].slice.call(this.ganttChartTableBody.querySelectorAll('tr'));
10246
10272
  this.ganttChartTableBody.innerHTML = '';
10247
10273
  var collapsedResourceRecord = [];
@@ -10272,6 +10298,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10272
10298
  }
10273
10299
  }
10274
10300
  else {
10301
+ var dupChartBody = void 0;
10302
+ dupChartBody = createElement('tbody', {
10303
+ id: this.parent.element.id + 'GanttTaskTableBody'
10304
+ });
10275
10305
  for (var i = 0; i < this.parent.currentViewData.length; i++) {
10276
10306
  var tempTemplateData = this.parent.currentViewData[i];
10277
10307
  if (this.parent.viewType === 'ResourceView') {
@@ -10284,9 +10314,9 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10284
10314
  }
10285
10315
  }
10286
10316
  var tRow = this.getGanttChartRow(i, tempTemplateData);
10287
- this.ganttChartTableBody.appendChild(tRow);
10317
+ dupChartBody.appendChild(tRow);
10288
10318
  if (this.parent.enableImmutableMode) {
10289
- this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[i]);
10319
+ this.refreshedTr.push(dupChartBody.querySelectorAll('tr')[i]);
10290
10320
  this.refreshedData.push(this.parent.currentViewData[i]);
10291
10321
  }
10292
10322
  // To maintain selection when virtualization is enabled
@@ -10294,6 +10324,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10294
10324
  this.parent.selectionModule.maintainSelectedRecords(parseInt(tRow.getAttribute('aria-rowindex'), 10));
10295
10325
  }
10296
10326
  }
10327
+ (_a = this.ganttChartTableBody).replaceChildren.apply(_a, dupChartBody.childNodes);
10297
10328
  }
10298
10329
  this.parent.renderTemplates();
10299
10330
  this.triggerQueryTaskbarInfo();
@@ -10340,7 +10371,6 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10340
10371
  }
10341
10372
  if (this.templateData.hasChildRecords) {
10342
10373
  var parentTaskbarTemplateNode = this.getParentTaskbarNode(i, taskbarContainerNode);
10343
- var milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
10344
10374
  if (!this.templateData.ganttProperties.isAutoSchedule) {
10345
10375
  var manualTaskbar = this.getManualTaskbar();
10346
10376
  if (!isNullOrUndefined(manualTaskbar[0])) {
@@ -10352,11 +10382,14 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10352
10382
  taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
10353
10383
  }
10354
10384
  }
10355
- if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
10385
+ if ((this.templateData.ganttProperties.autoDuration !== 0) && !this.templateData.ganttProperties.isMilestone && parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
10356
10386
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
10357
10387
  }
10358
- else if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
10359
- taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
10388
+ else if ((this.templateData.ganttProperties.duration === 0 && this.templateData.ganttProperties.isMilestone && this.templateData.ganttProperties.isAutoSchedule)) {
10389
+ var milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
10390
+ if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
10391
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
10392
+ }
10360
10393
  }
10361
10394
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
10362
10395
  this.templateData.ganttProperties.baselineEndDate) {
@@ -11507,7 +11540,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
11507
11540
  this.dateValidateModule.calculateEndDate(childGanttRecord);
11508
11541
  }
11509
11542
  this.parent.dataOperation.updateWidthLeft(childGanttRecord);
11510
- if (!this.parent.isLoad && childGanttRecord.parentItem && this.parent.isInPredecessorValidation &&
11543
+ if (!this.parent.isLoad && !this.parent.isFromOnPropertyChange && childGanttRecord.parentItem && this.parent.isInPredecessorValidation &&
11511
11544
  this.parent.getParentTask(childGanttRecord.parentItem).ganttProperties.isAutoSchedule) {
11512
11545
  if (this.parentIds.indexOf(childGanttRecord.parentItem.uniqueID) === -1) {
11513
11546
  this.parentIds.push(childGanttRecord.parentItem.uniqueID);
@@ -14572,6 +14605,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14572
14605
  * @private
14573
14606
  */
14574
14607
  Gantt.prototype.renderGantt = function (isChange) {
14608
+ if (isChange) {
14609
+ this.isFromOnPropertyChange = isChange;
14610
+ }
14575
14611
  // predecessor calculation
14576
14612
  if (this.predecessorModule && this.taskFields.dependency) {
14577
14613
  this.predecessorModule['parentIds'] = [];
@@ -14586,7 +14622,6 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14586
14622
  this.timelineModule.validateTimelineProp();
14587
14623
  }
14588
14624
  if (isChange) {
14589
- this.isFromOnPropertyChange = isChange;
14590
14625
  if (this.enableValidation) {
14591
14626
  this.dataOperation.updateGanttData();
14592
14627
  }
@@ -19802,7 +19837,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19802
19837
  : ganttRecord.left;
19803
19838
  var tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.bottomTier :
19804
19839
  this.parent.timelineModule.topTier;
19805
- var remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left), 1, 'Day') / (1000 * 60 * 60 * 24)));
19840
+ var remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left, isNullOrUndefined(ganttRecord) ? ganttRecord.isMilestone : null, ganttRecord), 1, 'Day') / (1000 * 60 * 60 * 24)));
19806
19841
  var remainDays = this.parent.perDayWidth - (this.parent.perDayWidth / remainingContribution);
19807
19842
  var remainDaysInDecimal = remainDays / this.parent.perDayWidth;
19808
19843
  if (isRoundOff === undefined) {
@@ -19850,7 +19885,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19850
19885
  var milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
19851
19886
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
19852
19887
  /* To render the milestone in proper date while editing */
19853
- if (isMilestone) {
19888
+ if (isMilestone && !isNullOrUndefined(property.predecessor) && property.predecessor.length > 0) {
19854
19889
  pStartDate.setDate(pStartDate.getDate() - 1);
19855
19890
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
19856
19891
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
@@ -22407,6 +22442,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22407
22442
  DialogEdit.prototype.renderNotesTab = function (itemName) {
22408
22443
  var ganttObj = this.parent;
22409
22444
  var inputModel = this.beforeOpenArgs[itemName];
22445
+ inputModel.enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
22410
22446
  var ganttProp = this.editedRecord.ganttProperties;
22411
22447
  var divElement = this.createDivElement('', ganttObj.element.id + '' + itemName + 'TabContainer');
22412
22448
  RichTextEditor.Inject(Toolbar$2, Link, HtmlEditor, QuickToolbar, Count);
@@ -24752,7 +24788,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24752
24788
  this.parent.predecessorModule.isValidatedParentTaskID = '';
24753
24789
  }
24754
24790
  if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
24755
- (args.action === "DrawConnectorLine")) {
24791
+ (args.action === "DrawConnectorLine") || (args.action === "DialogEditing")) {
24756
24792
  this.updateChildItems(ganttRecord);
24757
24793
  }
24758
24794
  this.updateParentItemOnEditing();
@@ -25026,7 +25062,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25026
25062
  }
25027
25063
  else if (isNullOrUndefined(previousData)) {
25028
25064
  calcEndDate = previousStartDate;
25029
- this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
25065
+ var initialData = this.parent.initialLoadData[childRecords[i].index];
25066
+ if (this.parent.isLoad) {
25067
+ this.calculateDateByRoundOffDuration(initialData, calcEndDate);
25068
+ }
25069
+ else {
25070
+ this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
25071
+ }
25030
25072
  if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
25031
25073
  this.validatedChildItems.push(childRecords[i]);
25032
25074
  }
@@ -29491,12 +29533,14 @@ var NonWorkingDay = /** @__PURE__ @class */ (function () {
29491
29533
  };
29492
29534
  NonWorkingDay.prototype.updateHolidayLabelHeight = function () {
29493
29535
  var height = this.parent.getContentHeight();
29536
+ var gantttable = document.getElementById("ganttContainer");
29494
29537
  // eslint-disable-next-line
29495
29538
  var toolbarHeight = 0;
29496
29539
  if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
29497
29540
  toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
29498
29541
  }
29499
- var viewportHeight = this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
29542
+ var viewportHeight = (this.parent.height === 'auto') ? gantttable.offsetHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight :
29543
+ this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
29500
29544
  var top = (viewportHeight < height) ? viewportHeight / 2 : height / 2;
29501
29545
  var labels = this.holidayContainer.querySelectorAll('.' + holidayLabel);
29502
29546
  for (var i = 0; i < labels.length; i++) {
@@ -30799,7 +30843,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
30799
30843
  splitTaskDuration = Math.ceil(currentTaskDifference / this.parent.timelineSettings.timelineUnitSize);
30800
30844
  splitTaskDuration -= 1;
30801
30845
  }
30802
- var contextMenuClickDate = this.parent.dataOperation.getEndDate(startDate, splitTaskDuration, this.rowData.ganttProperties.durationUnit, this.rowData, false);
30846
+ var contextMenuClickDate = this.parent.dataOperation.getEndDate(startDate, splitTaskDuration, (this.parent.timelineSettings.bottomTier.unit !== "None") ? this.parent.timelineSettings.bottomTier.unit.toLocaleLowerCase() : this.parent.timelineSettings.topTier.unit.toLocaleLowerCase(), this.rowData, false);
30803
30847
  return contextMenuClickDate;
30804
30848
  };
30805
30849
  ContextMenu$$1.prototype.contextMenuBeforeOpen = function (args) {