@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.
@@ -2785,7 +2785,7 @@ class TaskProcessor extends DateProcessor {
2785
2785
  }
2786
2786
  else {
2787
2787
  if (isValid) {
2788
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2788
+ return ((this.getTimeDifference(sDate, eDate, true) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2789
2789
  }
2790
2790
  else {
2791
2791
  return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
@@ -6499,8 +6499,10 @@ class Timeline {
6499
6499
  }
6500
6500
  }
6501
6501
  calculateNumberOfTimelineCells(newTimeline) {
6502
- const numberOfDays = Math.abs((this.parent.cloneProjectEndDate.getTime() -
6503
- this.parent.cloneProjectStartDate.getTime()) / (24 * 60 * 60 * 1000));
6502
+ const sDate = new Date(this.parent.cloneProjectStartDate.getTime());
6503
+ const eDate = new Date(this.parent.cloneProjectEndDate.getTime());
6504
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
6505
+ const numberOfDays = Math.abs((eDate.getTime() - sDate.getTime()) / (24 * 60 * 60 * 1000));
6504
6506
  const count = newTimeline.bottomTier.count;
6505
6507
  const unit = newTimeline.bottomTier.unit;
6506
6508
  if (unit === 'Day') {
@@ -7339,24 +7341,35 @@ class Timeline {
7339
7341
  case 'Day':
7340
7342
  lastDay.setHours(24, 0, 0, 0);
7341
7343
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
7344
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7342
7345
  break;
7343
7346
  case 'Hour':
7344
7347
  lastDay.setMinutes(60);
7345
7348
  lastDay.setSeconds(0);
7346
7349
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
7347
- increment = this.checkDate(firstDay, lastDay, increment, count);
7350
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7348
7351
  break;
7349
7352
  case 'Minutes':
7350
7353
  lastDay.setSeconds(60);
7351
7354
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * (count - 1));
7355
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7352
7356
  break;
7353
7357
  }
7354
7358
  return increment;
7355
7359
  }
7356
- checkDate(firstDay, lastDay, increment, count) {
7360
+ checkDate(firstDay, lastDay, increment, count, mode) {
7357
7361
  var date = new Date(firstDay.getTime());
7358
7362
  date.setTime(date.getTime() + increment);
7359
- if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7363
+ if (mode === "Day" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7364
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24);
7365
+ if (!this.parent.isInDst(date)) {
7366
+ increment += (1000 * 60 * 60 * diffCount);
7367
+ }
7368
+ else if (this.parent.isInDst(date) && count !== 2) {
7369
+ increment -= (1000 * 60 * 60 * diffCount);
7370
+ }
7371
+ }
7372
+ else if (mode === "Hour" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7360
7373
  var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
7361
7374
  if (!this.parent.isInDst(date)) {
7362
7375
  increment += (1000 * 60 * 60 * diffCount);
@@ -7365,6 +7378,15 @@ class Timeline {
7365
7378
  increment -= (1000 * 60 * 60 * diffCount);
7366
7379
  }
7367
7380
  }
7381
+ else if (mode === "Minutes" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7382
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60);
7383
+ if (!this.parent.isInDst(date)) {
7384
+ increment += (1000 * 60 * 60 * diffCount);
7385
+ }
7386
+ else if (this.parent.isInDst(date) && count !== 2) {
7387
+ increment -= (1000 * 60 * 60 * diffCount);
7388
+ }
7389
+ }
7368
7390
  return increment;
7369
7391
  }
7370
7392
  /**
@@ -7432,6 +7454,18 @@ class Timeline {
7432
7454
  this.parent.globalize.formatDate(scheduleWeeks, { format: this.parent.getDateFormat() }) :
7433
7455
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
7434
7456
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7457
+ const newDate = new Date(scheduleWeeks.getTime() + this.getIncrement(scheduleWeeks, count, mode));
7458
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks)) ||
7459
+ (this.parent.isInDst(newDate) && !this.parent.isInDst(scheduleWeeks))) {
7460
+ let temp;
7461
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks))) {
7462
+ temp = this.getIncrement(scheduleWeeks, count, mode) - (1000 * 60 * 60);
7463
+ }
7464
+ else {
7465
+ temp = this.getIncrement(scheduleWeeks, count, mode) + (1000 * 60 * 60);
7466
+ }
7467
+ thWidth = (temp / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7468
+ }
7435
7469
  const cellWidth = thWidth;
7436
7470
  thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
7437
7471
  : thWidth;
@@ -7473,7 +7507,10 @@ class Timeline {
7473
7507
  * @private
7474
7508
  */
7475
7509
  calculateWidthBetweenTwoDate(mode, scheduleWeeks, endDate) {
7476
- let timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
7510
+ const sDate = new Date(scheduleWeeks.getTime());
7511
+ const eDate = new Date(endDate.getTime());
7512
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
7513
+ let timeDifference = (eDate.getTime() - sDate.getTime());
7477
7514
  const balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
7478
7515
  return balanceDay * this.parent.perDayWidth;
7479
7516
  }
@@ -22444,8 +22481,8 @@ class DialogEdit {
22444
22481
  else {
22445
22482
  this.parent.showSpinner();
22446
22483
  }
22447
- this.renderTabItems();
22448
22484
  if (!arg.cancel) {
22485
+ this.renderTabItems();
22449
22486
  tabModel.selected = this.tabSelectedEvent.bind(this);
22450
22487
  tabModel.height = this.parent.isAdaptive ? '100%' : 'auto';
22451
22488
  tabModel.overflowMode = 'Scrollable';
@@ -22482,6 +22519,15 @@ class DialogEdit {
22482
22519
  }
22483
22520
  });
22484
22521
  }
22522
+ else {
22523
+ arg.cancel = false;
22524
+ if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
22525
+ this.parent.hideMaskRow();
22526
+ }
22527
+ else {
22528
+ this.parent.hideSpinner();
22529
+ }
22530
+ }
22485
22531
  });
22486
22532
  }
22487
22533
  changeFormObj(actionCompleteArgs, isCustomTab) {