|
|
@ -70,6 +70,15 @@ $(document).ready(function () { |
|
|
|
$("#name_milestone").val(data.text); |
|
|
|
$("#name_milestone").val(data.text); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#due_milestone').datepicker({ |
|
|
|
|
|
|
|
format: 'dd-mm-yyyy', // Set the desired format
|
|
|
|
|
|
|
|
autoclose: true // Close the datepicker when a date is selected
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#deadline_milestone').datepicker({ |
|
|
|
|
|
|
|
format: 'dd-mm-yyyy', // Set the desired format
|
|
|
|
|
|
|
|
autoclose: true // Close the datepicker when a date is selected
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('#modal-material').on('show.bs.modal', function (event) { |
|
|
|
$('#modal-material').on('show.bs.modal', function (event) { |
|
|
|
|
|
|
|
|
|
|
@ -88,8 +97,8 @@ $(document).ready(function () { |
|
|
|
console.log("cek data form", data); |
|
|
|
console.log("cek data form", data); |
|
|
|
let parent = data.milestone_parent; |
|
|
|
let parent = data.milestone_parent; |
|
|
|
var taskId = 0; |
|
|
|
var taskId = 0; |
|
|
|
var start = moment(data.due_date, "YYYY-MM-DD"); |
|
|
|
var start = moment(data.due_date, "DD-MM-YYYY"); |
|
|
|
var end = moment(data.deadline, "YYYY-MM-DD"); |
|
|
|
var end = moment(data.deadline, "DD-MM-YYYY"); |
|
|
|
let duration = moment.duration(start.diff(end)).asDays(); |
|
|
|
let duration = moment.duration(start.diff(end)).asDays(); |
|
|
|
let nameMilestone = data.status!="" ? data.status : data.id_milestone |
|
|
|
let nameMilestone = data.status!="" ? data.status : data.id_milestone |
|
|
|
// console.log("cek duration", Math.abs(duration));
|
|
|
|
// console.log("cek duration", Math.abs(duration));
|
|
|
@ -97,8 +106,8 @@ $(document).ready(function () { |
|
|
|
taskId = gantt.addTask({ |
|
|
|
taskId = gantt.addTask({ |
|
|
|
id: Math.floor(Math.random() * 1000) + 5000, |
|
|
|
id: Math.floor(Math.random() * 1000) + 5000, |
|
|
|
text: nameMilestone, |
|
|
|
text: nameMilestone, |
|
|
|
start_date: data.due_date, |
|
|
|
start_date: start.format("YYYY-MM-DD"), |
|
|
|
end_date: data.deadline, |
|
|
|
end_date: end.format("YYYY-MM-DD"), |
|
|
|
duration: Math.abs(duration), |
|
|
|
duration: Math.abs(duration), |
|
|
|
type: "milestone", |
|
|
|
type: "milestone", |
|
|
|
type_activity:"milestone" |
|
|
|
type_activity:"milestone" |
|
|
@ -107,8 +116,8 @@ $(document).ready(function () { |
|
|
|
taskId = gantt.addTask({ |
|
|
|
taskId = gantt.addTask({ |
|
|
|
id: Math.floor(Math.random() * 1000) + 5000, |
|
|
|
id: Math.floor(Math.random() * 1000) + 5000, |
|
|
|
text: nameMilestone, |
|
|
|
text: nameMilestone, |
|
|
|
start_date: data.due_date, |
|
|
|
start_date: start.format("YYYY-MM-DD"), |
|
|
|
end_date: data.deadline, |
|
|
|
end_date: end.format("YYYY-MM-DD"), |
|
|
|
duration: Math.abs(duration), |
|
|
|
duration: Math.abs(duration), |
|
|
|
type: "milestone", |
|
|
|
type: "milestone", |
|
|
|
type_activity:"milestone" |
|
|
|
type_activity:"milestone" |
|
|
|