Ask for help related to our 2.x versions.

Post by guilhermegallina »

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
I suppose it's related to Brazilian Daylight Saving Time of 2020, that begins on November 1st, 2020.
Here is the original code:
     * 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           = [],
            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?

Post by mats »

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:

Post Reply