bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
55 stars 6 forks source link

[Ext JS] The StartDate is wrong after converting a task to milestone #6473

Closed arcady-zherdev closed 1 year ago

arcady-zherdev commented 1 year ago

SampleProject(1).zip Forum post

It can be reproduced in msproject_import sample.

Say the working duration is 8AM ~ 5PM and there is a one day task [2019/4/8 8AM ~ 2019/4/8 5PM). The StartDate should be changed to 2019/4/8 5PM(same with EndDate) when converting it to milestone since the duration of a milestone is zero. But the StartDate is changed to 2019/4/9 8AM actually. Then the converted milestone will be in error state since StartDate(2019/4/9 8AM) is later than EndDate(2019/4/8 5PM)

arcady-zherdev commented 1 year ago

The issue reason is skipping of non-working time. Here is a workaround:

Ext,define('MyApp.Task', {
    extend  : 'Gnt.model.Task',

    convertToMilestoneWithoutPropagation : function() {
        var me = this,
            propagate = false;

        if (!me.isMilestone()) {
            propagate = me.setStartDateWithoutPropagation(me.getEndDate(), false, false);

            var taskStore             = me.getTaskStore(true),
                scheduleByConstraints = taskStore && taskStore.scheduleByConstraints;

            if (scheduleByConstraints) {
                me.markForRescheduling();
            }
        }

        return propagate;
    }
});
arcady-zherdev commented 1 year ago

Fixed in Gantt for ExtJS v6.1.20