gantt-task-react-powern 0.6.26 → 0.6.28
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.
- package/dist/index.js +26 -16
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +26 -16
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1115,13 +1115,21 @@ function toDateString(date) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
1117
|
function isHoliday(date, cal) {
|
|
1118
|
-
|
|
1118
|
+
if (cal.holidays && cal.holidays.length > 0) {
|
|
1119
|
+
return cal.holidays.includes(toDateString(date));
|
|
1120
|
+
} else {
|
|
1121
|
+
return false;
|
|
1122
|
+
}
|
|
1119
1123
|
}
|
|
1120
1124
|
function isOffDay(date, cal) {
|
|
1121
|
-
|
|
1125
|
+
if (cal.off_days && cal.off_days.length > 0) {
|
|
1126
|
+
return cal.off_days.includes(date.getDay()) || isHoliday(date, cal);
|
|
1127
|
+
} else {
|
|
1128
|
+
return false;
|
|
1129
|
+
}
|
|
1122
1130
|
}
|
|
1123
1131
|
function getShiftsForDay(date, cal) {
|
|
1124
|
-
if (isOffDay(date, cal)) return [];
|
|
1132
|
+
if (isOffDay(date, cal) || !cal.shifts) return [];
|
|
1125
1133
|
return cal.shifts.map(function (_ref) {
|
|
1126
1134
|
var s = _ref[0],
|
|
1127
1135
|
e = _ref[1];
|
|
@@ -4652,25 +4660,27 @@ function computeCriticalPath(taskID, taskMap) {
|
|
|
4652
4660
|
var endWeek = Math.floor((depEnd / 86400000 + 4) / 7);
|
|
4653
4661
|
var offTime = 0;
|
|
4654
4662
|
|
|
4655
|
-
if (taskMap[dependents[j]].task.calendar
|
|
4656
|
-
|
|
4657
|
-
for (var
|
|
4658
|
-
var
|
|
4659
|
-
|
|
4663
|
+
if (taskMap[dependents[j]].task.calendar) {
|
|
4664
|
+
if (taskMap[dependents[j]].task.calendar.off_days && taskMap[dependents[j]].task.calendar.off_days.length) {
|
|
4665
|
+
for (var d = 0; d < taskMap[dependents[j]].task.calendar.off_days.length || 0; d++) {
|
|
4666
|
+
for (var w = startWeek; w <= endWeek; w++) {
|
|
4667
|
+
var dayOfTheWeek = taskMap[dependents[j]].task.calendar.off_days[d];
|
|
4668
|
+
var offDay = 86400000 * (7 * w - 4 + dayOfTheWeek);
|
|
4660
4669
|
|
|
4661
|
-
|
|
4662
|
-
|
|
4670
|
+
if (offDay >= depStart && offDay <= depEnd && (offDay > taskMap[taskID].end || taskMap[taskID].task.calendar.off_days.includes(dayOfTheWeek))) {
|
|
4671
|
+
offTime += 86400000;
|
|
4672
|
+
}
|
|
4663
4673
|
}
|
|
4664
4674
|
}
|
|
4665
4675
|
}
|
|
4666
|
-
}
|
|
4667
4676
|
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4677
|
+
if (taskMap[dependents[j]].task.calendar.holidays && taskMap[dependents[j]].task.calendar.holidays.length) {
|
|
4678
|
+
for (var h = 0; h < taskMap[dependents[j]].task.calendar.holidays.length || 0; h++) {
|
|
4679
|
+
var holiday = taskMap[dependents[j]].task.calendar.holidays[h];
|
|
4671
4680
|
|
|
4672
|
-
|
|
4673
|
-
|
|
4681
|
+
if (holiday >= depStart && holiday <= depEnd) {
|
|
4682
|
+
offTime += 86400000;
|
|
4683
|
+
}
|
|
4674
4684
|
}
|
|
4675
4685
|
}
|
|
4676
4686
|
}
|