gantt-task-react-powern 0.4.65 → 0.4.67

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
@@ -275,9 +275,6 @@ var getWeekNumberISO8601 = function getWeekNumberISO8601(date) {
275
275
  return weekNumber;
276
276
  }
277
277
  };
278
- var getDaysInMonth = function getDaysInMonth(month, year) {
279
- return new Date(year, month + 1, 0).getDate();
280
- };
281
278
 
282
279
  var styles = {"ganttTable":"_3_ygE","ganttTable_Header":"_1nBOt","ganttTable_HeaderSeparator":"_2eZzQ","ganttTable_HeaderItem":"_WuQ0f"};
283
280
 
@@ -1066,7 +1063,21 @@ var Calendar = function Calendar(_ref) {
1066
1063
  x1Line: columnWidth * (i + 1),
1067
1064
  y1Line: 0,
1068
1065
  y2Line: topDefaultHeight,
1069
- xText: columnWidth * (i + 1) - getDaysInMonth(date.getMonth(), date.getFullYear()) * columnWidth * 0.5,
1066
+ xText: topValues.length === 0 ? columnWidth * (i + 1) * 0.5 : columnWidth * (i + 1) - date.getDate() * columnWidth * 0.5,
1067
+ yText: topDefaultHeight * 0.9
1068
+ }));
1069
+ }
1070
+
1071
+ if (i + 1 === dates.length) {
1072
+ var _topValue = getLocaleMonth(date, locale) + " " + date.getFullYear();
1073
+
1074
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
1075
+ key: _topValue + date.getFullYear(),
1076
+ value: _topValue,
1077
+ x1Line: columnWidth * (i + 1),
1078
+ y1Line: 0,
1079
+ y2Line: topDefaultHeight,
1080
+ xText: columnWidth * (i + 1) - date.getDate() * columnWidth * 0.5,
1070
1081
  yText: topDefaultHeight * 0.9
1071
1082
  }));
1072
1083
  }
@@ -2760,8 +2771,12 @@ var Gantt = function Gantt(_ref) {
2760
2771
  secondaryPath = _getCriticalPaths[1];
2761
2772
 
2762
2773
  uncolorAll(tasks);
2763
- colorPath(secondaryPath, "#00ff00", tasks);
2764
- colorPath(primaryPath, "#ff0000", tasks);
2774
+
2775
+ if (scheduleType !== "lookAhead") {
2776
+ colorPath(secondaryPath, "#00ff00", tasks);
2777
+ colorPath(primaryPath, "#ff0000", tasks);
2778
+ }
2779
+
2765
2780
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
2766
2781
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor, rtl, scrollX, onExpanderClick]);
2767
2782
  React.useEffect(function () {