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