Browse Source

send overdue data to fe

pull/1/head
wahyu 1 year ago
parent
commit
720304c977
  1. 11
      view-mode/function/ganttConfig.js

11
view-mode/function/ganttConfig.js

@ -379,7 +379,7 @@ gantt.templates.task_class = function (start, end, task) {
return classes.join(' ');
}
};
let dataOverdue = [];
gantt.templates.rightside_text = function (start, end, task) {
if (task.planned_end) {
if (end.getTime() > task.planned_end.getTime()) {
@ -398,6 +398,15 @@ gantt.templates.rightside_text = function (start, end, task) {
end_date: end,
task: task
}, 'day');
let found = dataOverdue.find((element) => element.id == task.id);
if (!found) {
dataOverdue.push({
id: task.id,
text: task.text,
overdue: overdue
})
}
window.parent.postMessage({ type: 'dataOverdueUpdate', dataOverdue: dataOverdue }, '*');
var text = "<b style='color: red;'>Overdue: " + overdue + " days</b>";
return text;
}

Loading…
Cancel
Save