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(' '); return classes.join(' ');
} }
}; };
let dataOverdue = [];
gantt.templates.rightside_text = function (start, end, task) { gantt.templates.rightside_text = function (start, end, task) {
if (task.planned_end) { if (task.planned_end) {
if (end.getTime() > task.planned_end.getTime()) { if (end.getTime() > task.planned_end.getTime()) {
@ -398,6 +398,15 @@ gantt.templates.rightside_text = function (start, end, task) {
end_date: end, end_date: end,
task: task task: task
}, 'day'); }, '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>"; var text = "<b style='color: red;'>Overdue: " + overdue + " days</b>";
return text; return text;
} }

Loading…
Cancel
Save