auto correction of work date while adding tasks

Hi,

I am trying to add tasks on saturday and sunday, using work_time and correct_work_item the task
should get readjusted but its is not. following is my code.

gantt.config.xml_date = "%Y,%m,%d"; gantt.config.work_time = true; gantt.config.correct_work_time = true; gantt.config.date_grid = "%j-%M-%Y"; gantt.config.scale_unit = "day"; gantt.config.date_scale = "%D, %d"; gantt.config.duration_unit = "day"; gantt.config.step = 1; gantt.config.scale_height = 20 * 3; gantt.config.details_on_create = true; gantt.config.highlight_critical_path = true; gantt.config.show_progress = true; gantt.config.skip_off_time = true; gantt.setWorkTime({hours: [9, 18]}); gantt.config.grid_resize = true; gantt.config.order_branch = true; gantt.config.sort = true; gantt.config.subscales = [ {unit: "month", step: 1, date: "%F, %Y"}, // {unit:"hour", step:1, date:"%H" } ]; gantt.templates.task_cell_class = function(task, date) { if (!gantt.isWorkTime(date)) return "week_end"; return ""; }; gantt.templates.scale_cell_class = function(date) { if (date.getDay() === 0 || date.getDay() === 6) { return "weekend"; } }; gantt.templates.task_cell_class = function(item, date) { if (date.getDay() === 0 || date.getDay() === 6) { return "weekend"; } };


Hi,
can you provide a steps to reproduce the problem and give a snapshot of test data? you can do JSON.stringify(gantt.serialize()) from browser console
So far i couldn’t reproduce the problem neither on the online samples by applying gantt.config.correct_work_time = true; gantt.config.skip_off_time = true;nor locally after copying your code into one of examples
screencast.com/t/TkNBqa0Xb0p
screencast.com/t/UzSczRZWyb

Hi,

What I am trying to do is while adding tasks, I am giving saturday as the start date and sunday as the end date. so the task has to get adjusted to monday as start date and tuesday as the end date automatically using those properties provided in the gantt api, but it is not happening?