|
|
@ -63,13 +63,17 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) { |
|
|
|
data['start_date'] = `${data.start_date}+07`; |
|
|
|
data['start_date'] = `${data.start_date}+07`; |
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
data['end_date'] = endDate.format("YYYY-MM-DD")+" 23:59:59+07"; |
|
|
|
data['end_date'] = endDate.format("YYYY-MM-DD")+" 23:59:59+07"; |
|
|
|
|
|
|
|
let newDuration = gantt.calculateDuration({ |
|
|
|
|
|
|
|
start_date: new Date(data['start_date']), |
|
|
|
|
|
|
|
end_date: new Date(data['end_date']) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
data['duration'] = newDuration; |
|
|
|
|
|
|
|
|
|
|
|
if(data && data.parent){ |
|
|
|
if(data && data.parent){ |
|
|
|
data['parent_id'] = data.parent; |
|
|
|
data['parent_id'] = data.parent; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
data['version_gantt_id'] = ganttId; |
|
|
|
data['version_gantt_id'] = ganttId; |
|
|
|
data['duration'] += 1; |
|
|
|
|
|
|
|
return gantt.ajax.post({ |
|
|
|
return gantt.ajax.post({ |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
"Content-Type": "application/json", |
|
|
|
"Content-Type": "application/json", |
|
|
@ -94,6 +98,11 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) { |
|
|
|
// data['start_date'] = startDate.format("YYYY-MM-DD")+" 00:00:00+07";
|
|
|
|
// data['start_date'] = startDate.format("YYYY-MM-DD")+" 00:00:00+07";
|
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
data['end_date'] = endDate.format("YYYY-MM-DD")+" 23:59:59+07"; |
|
|
|
data['end_date'] = endDate.format("YYYY-MM-DD")+" 23:59:59+07"; |
|
|
|
|
|
|
|
let newDuration = gantt.calculateDuration({ |
|
|
|
|
|
|
|
start_date: new Date(data['start_date']), |
|
|
|
|
|
|
|
end_date: new Date(data['end_date']) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
data['duration'] = newDuration; |
|
|
|
|
|
|
|
|
|
|
|
if(startDate > endDate){ |
|
|
|
if(startDate > endDate){ |
|
|
|
gantt.alert({ |
|
|
|
gantt.alert({ |
|
|
|