Browse Source

fix duration

pull/1/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
fc837efcc6
  1. 4
      edit-mode/function/restActivityLink.js

4
edit-mode/function/restActivityLink.js

@ -25,6 +25,7 @@ gantt.ajax.get({
});
function refresData(id){
console.log("refres triggered!!");
gantt.ajax.get({
url: `${base_url}activity/${ganttId}/${proyekId}/get`,
headers: {
@ -85,6 +86,7 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
break;
case "update":
if(entity=="task"){
// let startDate = moment(data.start_date, "YYYY-MM-DD").subtract(1, "days");
let startDate = moment(data.start_date, "YYYY-MM-DD");
data['start_date'] = startDate.format("YYYY-MM-DD")+" 00:00:00+07";
let endDate = moment(data.end_date, "YYYY-MM-DD");
@ -101,7 +103,7 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
return;
}
data['duration'] = moment.duration(endDate.diff(startDate)).asDays()+1;
data['duration'] += 1;
if(data && data.parent){
data['parent_id'] = data.parent;

Loading…
Cancel
Save