@syncfusion/ej2-gantt 24.1.41 → 24.1.43

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.
@@ -2824,7 +2824,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2824
2824
  }
2825
2825
  else {
2826
2826
  if (isValid) {
2827
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2827
+ return ((this.getTimeDifference(sDate, eDate, true) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2828
2828
  }
2829
2829
  else {
2830
2830
  return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
@@ -6568,8 +6568,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
6568
6568
  }
6569
6569
  };
6570
6570
  Timeline.prototype.calculateNumberOfTimelineCells = function (newTimeline) {
6571
- var numberOfDays = Math.abs((this.parent.cloneProjectEndDate.getTime() -
6572
- this.parent.cloneProjectStartDate.getTime()) / (24 * 60 * 60 * 1000));
6571
+ var sDate = new Date(this.parent.cloneProjectStartDate.getTime());
6572
+ var eDate = new Date(this.parent.cloneProjectEndDate.getTime());
6573
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
6574
+ var numberOfDays = Math.abs((eDate.getTime() - sDate.getTime()) / (24 * 60 * 60 * 1000));
6573
6575
  var count = newTimeline.bottomTier.count;
6574
6576
  var unit = newTimeline.bottomTier.unit;
6575
6577
  if (unit === 'Day') {
@@ -7411,24 +7413,35 @@ var Timeline = /** @__PURE__ @class */ (function () {
7411
7413
  case 'Day':
7412
7414
  lastDay.setHours(24, 0, 0, 0);
7413
7415
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
7416
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7414
7417
  break;
7415
7418
  case 'Hour':
7416
7419
  lastDay.setMinutes(60);
7417
7420
  lastDay.setSeconds(0);
7418
7421
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
7419
- increment = this.checkDate(firstDay, lastDay, increment, count);
7422
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7420
7423
  break;
7421
7424
  case 'Minutes':
7422
7425
  lastDay.setSeconds(60);
7423
7426
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * (count - 1));
7427
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7424
7428
  break;
7425
7429
  }
7426
7430
  return increment;
7427
7431
  };
7428
- Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count) {
7432
+ Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count, mode) {
7429
7433
  var date = new Date(firstDay.getTime());
7430
7434
  date.setTime(date.getTime() + increment);
7431
- if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7435
+ if (mode === "Day" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7436
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24);
7437
+ if (!this.parent.isInDst(date)) {
7438
+ increment += (1000 * 60 * 60 * diffCount);
7439
+ }
7440
+ else if (this.parent.isInDst(date) && count !== 2) {
7441
+ increment -= (1000 * 60 * 60 * diffCount);
7442
+ }
7443
+ }
7444
+ else if (mode === "Hour" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7432
7445
  var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
7433
7446
  if (!this.parent.isInDst(date)) {
7434
7447
  increment += (1000 * 60 * 60 * diffCount);
@@ -7437,6 +7450,15 @@ var Timeline = /** @__PURE__ @class */ (function () {
7437
7450
  increment -= (1000 * 60 * 60 * diffCount);
7438
7451
  }
7439
7452
  }
7453
+ else if (mode === "Minutes" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7454
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60);
7455
+ if (!this.parent.isInDst(date)) {
7456
+ increment += (1000 * 60 * 60 * diffCount);
7457
+ }
7458
+ else if (this.parent.isInDst(date) && count !== 2) {
7459
+ increment -= (1000 * 60 * 60 * diffCount);
7460
+ }
7461
+ }
7440
7462
  return increment;
7441
7463
  };
7442
7464
  /**
@@ -7504,6 +7526,18 @@ var Timeline = /** @__PURE__ @class */ (function () {
7504
7526
  this.parent.globalize.formatDate(scheduleWeeks, { format: this.parent.getDateFormat() }) :
7505
7527
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
7506
7528
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7529
+ var newDate = new Date(scheduleWeeks.getTime() + this.getIncrement(scheduleWeeks, count, mode));
7530
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks)) ||
7531
+ (this.parent.isInDst(newDate) && !this.parent.isInDst(scheduleWeeks))) {
7532
+ var temp = void 0;
7533
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks))) {
7534
+ temp = this.getIncrement(scheduleWeeks, count, mode) - (1000 * 60 * 60);
7535
+ }
7536
+ else {
7537
+ temp = this.getIncrement(scheduleWeeks, count, mode) + (1000 * 60 * 60);
7538
+ }
7539
+ thWidth = (temp / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7540
+ }
7507
7541
  var cellWidth = thWidth;
7508
7542
  thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
7509
7543
  : thWidth;
@@ -7545,7 +7579,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
7545
7579
  * @private
7546
7580
  */
7547
7581
  Timeline.prototype.calculateWidthBetweenTwoDate = function (mode, scheduleWeeks, endDate) {
7548
- var timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
7582
+ var sDate = new Date(scheduleWeeks.getTime());
7583
+ var eDate = new Date(endDate.getTime());
7584
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
7585
+ var timeDifference = (eDate.getTime() - sDate.getTime());
7549
7586
  var balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
7550
7587
  return balanceDay * this.parent.perDayWidth;
7551
7588
  };
@@ -22933,8 +22970,8 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22933
22970
  else {
22934
22971
  _this.parent.showSpinner();
22935
22972
  }
22936
- _this.renderTabItems();
22937
22973
  if (!arg.cancel) {
22974
+ _this.renderTabItems();
22938
22975
  tabModel.selected = _this.tabSelectedEvent.bind(_this);
22939
22976
  tabModel.height = _this.parent.isAdaptive ? '100%' : 'auto';
22940
22977
  tabModel.overflowMode = 'Scrollable';
@@ -22971,6 +23008,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22971
23008
  }
22972
23009
  });
22973
23010
  }
23011
+ else {
23012
+ arg.cancel = false;
23013
+ if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
23014
+ _this.parent.hideMaskRow();
23015
+ }
23016
+ else {
23017
+ _this.parent.hideSpinner();
23018
+ }
23019
+ }
22974
23020
  });
22975
23021
  };
22976
23022
  DialogEdit.prototype.changeFormObj = function (actionCompleteArgs, isCustomTab) {