Solving the problem with time in ExtJS 3 (after patch KB2998527)
Good day to all!
After reading another article about the problem with time in JavaScript (for Windows browsers (RU) after patch KB2998527 ), I began to realize that few people give a general solution for ExtJS 3. You
probably already know the problem, and if not, then it is worth reading the article "Chrome that stole Christmas . " It is important for web developers whose clients are from the Russian Federation.
Even before the article appeared, I came across this bug. At first, my colleague and I thought that there was a problem with updating Chrom, but after an hour we already found the component that caused it to hang, it turned out to be Ext.form.TimeField . Further analysis led to the function:
As you can see, a loop is used to get the values. At that time, I changed it to for c 0 to (24 * 60) / this.increment.
But after realizing what the problem was (in our case, this.initDate = '1/1/2008', where the next “missing” environment was 02/01/2008), he wrote a small patch:
Those. we just indicate the day, so that the next is not Wednesday, more . For new versions, everything is similar, they also use initDate there as 1/1/2008.
After reading another article about the problem with time in JavaScript (for Windows browsers (RU) after patch KB2998527 ), I began to realize that few people give a general solution for ExtJS 3. You
probably already know the problem, and if not, then it is worth reading the article "Chrome that stole Christmas . " It is important for web developers whose clients are from the Russian Federation.
Even before the article appeared, I came across this bug. At first, my colleague and I thought that there was a problem with updating Chrom, but after an hour we already found the component that caused it to hang, it turned out to be Ext.form.TimeField . Further analysis led to the function:
generateStore: function(initial){
var min = this.minValue || new Date(this.initDate).clearTime(),
max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1),
times = [];
while(min <= max){
times.push(min.dateFormat(this.format));
min = min.add('mi', this.increment);
}
this.bindStore(times, initial);
}
As you can see, a loop is used to get the values. At that time, I changed it to for c 0 to (24 * 60) / this.increment.
But after realizing what the problem was (in our case, this.initDate = '1/1/2008', where the next “missing” environment was 02/01/2008), he wrote a small patch:
Ext.override(Ext.form.TimeField, {
initDate: '2/1/2008'
});
Those. we just indicate the day, so that the next is not Wednesday, more . For new versions, everything is similar, they also use initDate there as 1/1/2008.