PDA

View Full Version : TimeField and DST problem (adding 1 hour to the field)



Manhani
9 Jun 2009, 6:34 AM
Hello people,

I'm having a problem with the TimeField component and it only occurs when i run the application at the web browsers. At the shell the problem does not happen.
When i retrieve a time from de database and set it on the TimeField, if the OS DST auto adjustment is active, when the field is shown at the browser, it simply sums 1 hour at the time. I don't know what to do to fix this problem. Can someone help me?? Im using GWT 1.5.3 and GXT 1.2.3

Thanks in advance.

vigosun
8 Sep 2009, 7:01 AM
I think reckon that problem in TimeField.initList();
In my case actual values of hours and min are correct but text value is one hour ahead.
So I fixed it in my code (I use time field in the grid):


@Override

public Object preProcessValue(Object value) {
if (value == null) {
return null;
}

DateWrapper temp = new DateWrapper((Date)value);
for(Time time:timeFromTo.getStore().getModels()){
if(time.getHour()==temp.getHours() && time.getMinutes()==temp.getMinutes()){
time.set("text", df.format(temp.asDate()));
return time;
}
}
return null;
}