-
Hello!!
where i need add this code? i'm using ext-2.2!
Code:
Ext.form.DateField.prototype.menuListeners.select = function(m, d) {
this.setValue(d);
this.fireEvent('dateselect');
}
Date.prototype.clearTime = function(clone){
if(clone){
return this.clone().clearTime();
}
if(this.getHours() == 23){
this.setTime(this.getTime()+(3600000));
}else{
this.setHours(0);
}
this.setMinutes(0);
this.setSeconds(0);
this.setMilliseconds(0);
return this;
};
-
Lombras,
This is an override to Ext's functions, so you should add this code to your project's javascript files, after the Ext library has been loaded. There's no need to modify the Ext library.
-
[ follow-up ]
here's a list of changes i'm proposing for Ext 2.2.1's DatePicker / Date which should do the trick for 1.x too as the DatePicker / Date codes haven't changed much since 1.x:
http://www.sencha.com/forum/showthread.php?p=302310
turns out it required a combination of both UTC format hour / minutes / seconds / milliseconds, a tiny change to clearTime()'s internals, and an additional check for DST to resolve the matter (see link for more details).
the reason why most of us in non-DST / english locales can't reproduce the problem on WinXP is that the DST timezones aren't automatically updated (requires a registry patch from m$).
-
I had the same problem. It turns out that if the date value in an Ext.data.Model is timezone unaware, then Firefox 6.0.2 converts the time to the client's timezone when loading data. I am in CST and therefore some dates appear to be the day before.
Picking and submitting dates worked fine. However, when the data is reloaded from the database the value is timezone unaware (e.g. '1972-10-29'). Instead of assuming UTC, in Firefox 6.0.2, the date is parsed and converted to the client timezone.
I was able to fix the problem by changing my Ext.data.Model configuration
FROM: {name: 'dob', type: 'date'},TO: {name: 'dob'},