feat: Enhance Gantt chart functionality with task filtering and styling improvements

This commit is contained in:
2025-04-13 01:01:59 +02:00
parent ebfc82095d
commit 6b40888d06
7 changed files with 90 additions and 23 deletions

View File

@@ -1751,9 +1751,9 @@ class Gantt {
}
refresh(tasks) {
this.setup_tasks(tasks);
this.synchronizing_date(tasks);
this.change_view_mode();
this.setup_tasks(tasks);
this.synchronizing_date(tasks);
this.change_view_mode();
}
change_view_mode(mode = this.options.view_mode) {
@@ -2206,13 +2206,22 @@ class Gantt {
// Rysujemy górny tekst
if (date.upper_text) {
const $upper_text = createSVG('text', {
x: date.upper_x + this.options.column_width,
y: date.upper_y,
innerHTML: date.upper_text,
class: 'upper-text',
append_to: this.layers.date
});
const original_date = this.dates[i];
const today = date_utils.today();
const isToday =
original_date.getDate() === today.getDate() &&
original_date.getMonth() === today.getMonth() &&
original_date.getFullYear() === today.getFullYear();
console.log(date.upper_text + ' | ' + isToday );
const $upper_text = createSVG('text', {
x: date.upper_x + this.options.column_width,
y: date.upper_y,
innerHTML: date.upper_text,
class: 'upper-text' + (isToday ? ' today-date' : ''),
append_to: this.layers.date
});
// Ramka na końcu kolumny
createSVG('line', {