@syncfusion/ej2-gantt 22.1.36 → 22.1.37

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.
@@ -1535,6 +1535,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
1535
1535
  setValue('minStartDate', minStartDate, editArgs);
1536
1536
  setValue('maxEndDate', maxEndDate, editArgs);
1537
1537
  }
1538
+ this.parent['isProjectDateUpdated'] = true;
1538
1539
  };
1539
1540
  /**
1540
1541
  *
@@ -2108,7 +2109,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2108
2109
  endDate = this.getEndDate(startDate, duration, data.ganttProperties.durationUnit, data.ganttProperties, false);
2109
2110
  }
2110
2111
  else if (!taskSettings.duration && taskSettings.endDate) {
2111
- endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() >
2112
+ endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() <
2112
2113
  data.ganttProperties.endDate.getTime() && i !== segments.length - 1 ? endDate : data.ganttProperties.endDate;
2113
2114
  duration = this.getDuration(startDate, endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
2114
2115
  if (ganttSegments.length > 0 && endDate.getTime() < startDate.getTime()
@@ -2752,38 +2753,59 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2752
2753
  modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 1000);
2753
2754
  }
2754
2755
  if (ganttData && ganttData.durationUnit == 'minute') {
2755
- modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 60 * 1000);
2756
+ modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 1000);
2756
2757
  }
2757
2758
  for (var i = 0; i < this.parent.dayWorkingTime.length; i++) {
2758
2759
  hour = hour + this.parent.dayWorkingTime[i].to - this.parent.dayWorkingTime[i].from;
2759
2760
  }
2760
2761
  var dateDiff = modifiedsDate.getTime() - sDate.getTime();
2761
- if (tierMode === 'Day') {
2762
- if ((Math.floor((dateDiff / (1000 * 60 * 60)) % 24) >= hour || dateDiff === 0)) {
2763
- isValid = true;
2762
+ if (ganttData && ganttData.durationUnit == 'minute' && ganttData.duration < (hour * 60)) {
2763
+ if (tierMode === 'Day') {
2764
+ if ((Math.floor((dateDiff / (1000 * 60 * 60)) % 24) >= hour || dateDiff === 0)) {
2765
+ isValid = true;
2766
+ }
2767
+ if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime && isValid) {
2768
+ sDate.setHours(0, 0, 0, 0);
2769
+ }
2770
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
2771
+ eDate.setHours(24);
2772
+ }
2773
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
2774
+ eDate.setHours(0, 0, 0, 0);
2775
+ }
2764
2776
  }
2765
- if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime && isValid) {
2766
- sDate.setHours(0, 0, 0, 0);
2777
+ else {
2778
+ isValid = true;
2767
2779
  }
2768
- if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
2769
- eDate.setHours(24);
2780
+ if ((sDate).getTime() === (eDate).getTime()) {
2781
+ return (this.parent.perDayWidth);
2770
2782
  }
2771
- if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
2772
- eDate.setHours(0, 0, 0, 0);
2783
+ else {
2784
+ if (isValid) {
2785
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2786
+ }
2787
+ else {
2788
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
2789
+ }
2773
2790
  }
2774
2791
  }
2775
2792
  else {
2776
- isValid = true;
2777
- }
2778
- if ((sDate).getTime() === (eDate).getTime()) {
2779
- return (this.parent.perDayWidth);
2780
- }
2781
- else {
2782
- if (isValid) {
2783
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2793
+ if (tierMode === 'Day') {
2794
+ if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime) {
2795
+ sDate.setHours(0, 0, 0, 0);
2796
+ }
2797
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
2798
+ eDate.setHours(24);
2799
+ }
2800
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
2801
+ eDate.setHours(0, 0, 0, 0);
2802
+ }
2803
+ }
2804
+ if ((sDate).getTime() === (eDate).getTime()) {
2805
+ return (this.parent.perDayWidth);
2784
2806
  }
2785
2807
  else {
2786
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
2808
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2787
2809
  }
2788
2810
  }
2789
2811
  };
@@ -5953,6 +5975,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5953
5975
  */
5954
5976
  Timeline.prototype.processZooming = function (isZoomIn) {
5955
5977
  this.isZoomToFit = false;
5978
+ if (!this.parent['isProjectDateUpdated']) {
5979
+ this.parent.dateValidationModule.calculateProjectDates();
5980
+ }
5956
5981
  if (!isNullOrUndefined(this.parent.zoomingProjectStartDate)) {
5957
5982
  this.parent.cloneProjectStartDate = this.parent.cloneProjectStartDate.getTime() < this.parent.zoomingProjectStartDate.getTime()
5958
5983
  ? this.parent.cloneProjectStartDate : this.parent.zoomingProjectStartDate;
@@ -20308,6 +20333,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20308
20333
  }
20309
20334
  }
20310
20335
  }
20336
+ this.parent['isProjectDateUpdated'] = false;
20311
20337
  };
20312
20338
  /**
20313
20339
  * To cancel the taskbar edt action.