Gantt for Ext JS Daylight Saving Time - IE11 gets frozen

Ask for help related to our 2.x versions.
Post Reply
User avatar
guilhermegallina
Posts: 1
Joined: Thu Sep 12, 2019 6:17 pm

Gantt for Ext JS Daylight Saving Time - IE11 gets frozen

Post by guilhermegallina » Thu Sep 12, 2019 6:40 pm

Hi,
I'm using version 2.5.9 of Gantt of Ext JS and, when the Gantt is loading, it makes Internet Explorer 11 (version 11.0.9600) gets frozen. Debugging file gnt-all.js, I could notice Gantt is getting infinite looping in function generateTicks from class Sch.data.TimeAxis.
I suppose it's related to Brazilian Daylight Saving Time of 2020, that begins on November 1st, 2020.
Here is the original code:

Code: Select all

/**
     * Method generating the ticks for this time axis. Should return an array of ticks. Each tick is an object of the following structure:
        {
            start       : ..., // start date
            end         : ...  // end date
        }
     *
     * Take notice, that this function either has to be called with `start`/`end` parameters, or create those variables.
     * 
     * @param {Date} startDate The start date of the interval
     * @param {Date} endDate The end date of the interval
     * @param {String} unit The unit of the time axis
     * @param {Mixed} increment The increment for the unit specified.
     * @return {Array} ticks The ticks representing the time axis
     */
    generateTicks : function (start, end, unit, increment) {
        var ticks           = [],
            intervalEnd,
            DATE            = Sch.util.Date,
            dstDiff         = 0;

        unit                = unit || this.unit;
        increment           = increment || this.increment;

        var adjusted        = this.getAdjustedDates(start, end);

        start               = adjusted.start;
        end                 = adjusted.end;

        while (start < end) {
            intervalEnd     = this.getNext(start, unit, increment);
            
            if (!this.autoAdjust && intervalEnd > end) intervalEnd = end;
            
            // Handle hourly increments crossing DST boundaries to keep the timescale looking correct
            // Only do this for HOUR resolution currently, and only handle it once per tick generation.
            if (unit === DATE.HOUR && increment > 1 && ticks.length > 0 && dstDiff === 0) {
                var prev    = ticks[ ticks.length - 1 ];
                
                dstDiff     = ((prev.start.getHours() + increment) % 24) - prev.end.getHours();

                if (dstDiff !== 0) {
                    // A DST boundary was crossed in previous tick, adjust this tick to keep timeaxis "symmetric".
                    intervalEnd = DATE.add(intervalEnd, DATE.HOUR, dstDiff);
                }
            }

            this.generateTicksValidatorFn(start) && ticks.push({
                start   : start,
                end     : intervalEnd
            });
            
            start           = intervalEnd;
        }
        
        return ticks;
    },
It seems that it's getting an infinite loop on that while statement, where the first parameter start is stuck in October 2020, where it reaches 31/10/2020 and then returns to 01/10/2020 and so on. Never gets to November 2020.

I'm afraid I don't have any test case info because it has just happened on our costumers' environment. I wasn't been able to reproduce it in our development environment.
Do you have any suggestion or fix for this issue?

User avatar
mats
Core Developer
Core Developer
Posts: 14658
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Gantt for Ext JS Daylight Saving Time - IE11 gets frozen

Post by mats » Fri Sep 13, 2019 9:51 am

Hi Guilherme,

Not much we can do. We’ve made so many changes (your version is > 4 years old) and I expect the issues you’re seeing is fixed in our latest version. The only thing we could offer would be a paid Professional Services gig to investigate your issue and see if we can back port a fix from our latest sources.

If interested you can find details here: https://bryntum.com/services
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

Post Reply