gantt-task-react-powern 0.6.27 → 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 CHANGED
@@ -1116,13 +1116,21 @@ function toDateString(date) {
1116
1116
  }
1117
1117
 
1118
1118
  function isHoliday(date, cal) {
1119
- return cal.holidays.includes(toDateString(date));
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
- return cal.off_days.includes(date.getDay()) || isHoliday(date, cal);
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];