|
|
|
@ -637,3 +637,32 @@ function resetActivity() {
|
|
|
|
|
localStorage.setItem('batchEntity', ''); |
|
|
|
|
gantt.alert("Actiivity Saved"); |
|
|
|
|
} |
|
|
|
|
// Function to get the earliest planned start date among all tasks
|
|
|
|
|
function getEarliestTaskDate() { |
|
|
|
|
var earliestDate = null; |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
var taskStartDate = task.planned_start || task.start_date; |
|
|
|
|
if (!earliestDate || task.planned_start < earliestDate) { |
|
|
|
|
earliestDate = taskStartDate; |
|
|
|
|
if (task.start_date < earliestDate) { |
|
|
|
|
earliestDate = task.start_date; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return earliestDate; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Function to get the latest planned end date among all tasks
|
|
|
|
|
function getLatestTaskDate() { |
|
|
|
|
var latestDate = null; |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
var taskEndDate = task.planned_end || task.end_date; |
|
|
|
|
if (!latestDate || task.planned_end > latestDate) { |
|
|
|
|
latestDate = taskEndDate; |
|
|
|
|
if (task.end_date > latestDate) { |
|
|
|
|
latestDate = task.end_date; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return latestDate; |
|
|
|
|
} |