|
|
|
@ -63,13 +63,17 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
data['start_date'] = `${data.start_date}+07`; |
|
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
|
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){ |
|
|
|
|
data['parent_id'] = data.parent; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
data['version_gantt_id'] = ganttId; |
|
|
|
|
data['duration'] += 1; |
|
|
|
|
return gantt.ajax.post({ |
|
|
|
|
headers: { |
|
|
|
|
"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";
|
|
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
|
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){ |
|
|
|
|
gantt.alert({ |
|
|
|
|