You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In yearMonth view aka DayView, the week numbering is incorrect if the most part of the current week is on the next month.
This year 2022 it occurs on the following weeks (with monday as first weekday) :
January 31st
March 28th
June 30th
September 29th
November 31st
December 28th
All these weeks have less than 3 days before next month. So according "packages/gantt/src/views/day.ts" (line 43) the week is increased by one in order to get next month name upper the week. But next to the month i also wrote the week number (see GANTT_GLOBAL_CONFIG up there). So the printed week number is the next one not the current one.
Expected Behavior :
I expect to get the correct week number, i don't care too much about month name but i think we can make an exception to get both the next month name and the correct week number.
Source of the issue:
class GanttViewDay extends GanttView {
//....
getPrimaryDatePoints() {
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value }, { weekStartsOn: 1 });
const points = [];
for (let i = 0; i < weeks.length; i++) {
const weekStart = new GanttDate(weeks[i]);
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat.yearMonth), (this.getCellWidth() * 7) / 2 + i * (this.getCellWidth() * 7), primaryDatePointTop);
points.push(point);
}
return points;
}
//....
}
The text was updated successfully, but these errors were encountered:
With the following configuration :
In yearMonth view aka DayView, the week numbering is incorrect if the most part of the current week is on the next month.
This year 2022 it occurs on the following weeks (with monday as first weekday) :
All these weeks have less than 3 days before next month. So according "packages/gantt/src/views/day.ts" (line 43) the week is increased by one in order to get next month name upper the week. But next to the month i also wrote the week number (see GANTT_GLOBAL_CONFIG up there). So the printed week number is the next one not the current one.
Expected Behavior :
I expect to get the correct week number, i don't care too much about month name but i think we can make an exception to get both the next month name and the correct week number.
Source of the issue:
The text was updated successfully, but these errors were encountered: