gantt-task-react-powern 0.6.26 → 0.6.27

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.
@@ -4652,25 +4652,27 @@ function computeCriticalPath(taskID, taskMap) {
4652
4652
  var endWeek = Math.floor((depEnd / 86400000 + 4) / 7);
4653
4653
  var offTime = 0;
4654
4654
 
4655
- if (taskMap[dependents[j]].task.calendar.off_days && taskMap[dependents[j]].task.calendar.off_days.length) {
4656
- for (var d = 0; d < taskMap[dependents[j]].task.calendar.off_days.length || 0; d++) {
4657
- for (var w = startWeek; w <= endWeek; w++) {
4658
- var dayOfTheWeek = taskMap[dependents[j]].task.calendar.off_days[d];
4659
- var offDay = 86400000 * (7 * w - 4 + dayOfTheWeek);
4660
-
4661
- if (offDay >= depStart && offDay <= depEnd && (offDay > taskMap[taskID].end || taskMap[taskID].task.calendar.off_days.includes(dayOfTheWeek))) {
4662
- offTime += 86400000;
4655
+ if (taskMap[dependents[j]].task.calendar) {
4656
+ if (taskMap[dependents[j]].task.calendar.off_days && taskMap[dependents[j]].task.calendar.off_days.length) {
4657
+ for (var d = 0; d < taskMap[dependents[j]].task.calendar.off_days.length || 0; d++) {
4658
+ for (var w = startWeek; w <= endWeek; w++) {
4659
+ var dayOfTheWeek = taskMap[dependents[j]].task.calendar.off_days[d];
4660
+ var offDay = 86400000 * (7 * w - 4 + dayOfTheWeek);
4661
+
4662
+ if (offDay >= depStart && offDay <= depEnd && (offDay > taskMap[taskID].end || taskMap[taskID].task.calendar.off_days.includes(dayOfTheWeek))) {
4663
+ offTime += 86400000;
4664
+ }
4663
4665
  }
4664
4666
  }
4665
4667
  }
4666
- }
4667
4668
 
4668
- if (taskMap[dependents[j]].task.calendar.holidays && taskMap[dependents[j]].task.calendar.holidays.length) {
4669
- for (var h = 0; h < taskMap[dependents[j]].task.calendar.holidays.length || 0; h++) {
4670
- var holiday = taskMap[dependents[j]].task.calendar.holidays[h];
4669
+ if (taskMap[dependents[j]].task.calendar.holidays && taskMap[dependents[j]].task.calendar.holidays.length) {
4670
+ for (var h = 0; h < taskMap[dependents[j]].task.calendar.holidays.length || 0; h++) {
4671
+ var holiday = taskMap[dependents[j]].task.calendar.holidays[h];
4671
4672
 
4672
- if (holiday >= depStart && holiday <= depEnd) {
4673
- offTime += 86400000;
4673
+ if (holiday >= depStart && holiday <= depEnd) {
4674
+ offTime += 86400000;
4675
+ }
4674
4676
  }
4675
4677
  }
4676
4678
  }