Browse Source

Fix end date setter getter

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
bfc5c319e0
  1. 8
      edit-mode/function/ganttConfig.js

8
edit-mode/function/ganttConfig.js

@ -143,14 +143,10 @@ function satuanLabel(task) {
// use the default editor custom for end_date, but override set_value/get_value methods // use the default editor custom for end_date, but override set_value/get_value methods
var dateEditor = gantt.config.editor_types.date; var dateEditor = gantt.config.editor_types.date;
gantt.config.editor_types.end_date = gantt.mixin({ gantt.config.editor_types.end_date = gantt.mixin({
set_value: function (value, id, column, node) {
var correctedValue = gantt.date.add(value, -1, "day");
return dateEditor.set_value.apply(this, [correctedValue, id, column, node]);
},
get_value: function (id, column, node) { get_value: function (id, column, node) {
var selectedValue = dateEditor.get_value.apply(this, [id, column, node]); var selectedValue = dateEditor.get_value.apply(this, [id, column, node]);
editEndDateTriggered = true; editEndDateTriggered = true;
return gantt.date.add(selectedValue, 1, "day"); return selectedValue;
}, },
}, dateEditor); }, dateEditor);
var durationEditor = gantt.config.editor_types.duration; var durationEditor = gantt.config.editor_types.duration;
@ -171,7 +167,7 @@ const editor = {
text: { type: "text", map_to: "text" }, text: { type: "text", map_to: "text" },
kode_sortname: { type: "text", map_to: "kode_sortname" }, kode_sortname: { type: "text", map_to: "kode_sortname" },
start_date: { type: "date", map_to: "start_date", min: new Date(2018, 0, 1) }, start_date: { type: "date", map_to: "start_date", min: new Date(2018, 0, 1) },
end_date: { type: "date", map_to: "end_date", min: new Date(2018, 0, 1) }, end_date: { type: "end_date", map_to: "end_date", min: new Date(2018, 0, 1) },
planned_start: { type: "date", map_to: "planned_start", min: new Date(2018, 0, 1) }, planned_start: { type: "date", map_to: "planned_start", min: new Date(2018, 0, 1) },
planned_end: { type: "date", map_to: "planned_end", min: new Date(2018, 0, 1) }, planned_end: { type: "date", map_to: "planned_end", min: new Date(2018, 0, 1) },
duration: { type: "duration", map_to: "duration", min: 0, max: 365, formatter: formatter }, duration: { type: "duration", map_to: "duration", min: 0, max: 365, formatter: formatter },

Loading…
Cancel
Save