Hi
I have a problem with DateTime item cause by a difference in timezone between the client and server. I tested this in SmartGWT 4.0 and 4.1
For my use, i need all the time and dates to be displayed with the timezone of the server, so when my application loads i call DateUtil.setDefaultDisplayTimezone() with the server timezone.
The problem happens when the client and server are not on the same timezone and have an big enough difference to have a different date. Example:
Client is in timezone -4, client date is : 06/05/2014 16:30
Server is in timezone +10, server date is 06/06/2014 06:30
See the difference in the day of the month.
Now, on the client i open a DateTimeItem and click "Today". The time set is going to be "06/05/2014 06:30".
Since i called DateUtil.setDefaultDisplayTimezone( "+10:00" ), should it be set to the server date?
It looks like the time has been converted to the server timezone, but the date part was not converted.
When the Today button is clicked i need to set the current server time, is there any settings i can set to do that?
Another problem i noticed only in Smartgwt 4.0 is that when you open the date picker again, the selected date go backward 1 day each time its opened.
So if you open the date picker, only change the time and click apply, the date has also changed...
Am i using the DateTimeItem correctly? Is there some settings to correct this behavior?
Thanks.
Tested with SmartGwt 4.0 and 4.1.
Tested on Firefox and Chrome
Here a simple example where i can reproduce the problem.
I have a problem with DateTime item cause by a difference in timezone between the client and server. I tested this in SmartGWT 4.0 and 4.1
For my use, i need all the time and dates to be displayed with the timezone of the server, so when my application loads i call DateUtil.setDefaultDisplayTimezone() with the server timezone.
The problem happens when the client and server are not on the same timezone and have an big enough difference to have a different date. Example:
Client is in timezone -4, client date is : 06/05/2014 16:30
Server is in timezone +10, server date is 06/06/2014 06:30
See the difference in the day of the month.
Now, on the client i open a DateTimeItem and click "Today". The time set is going to be "06/05/2014 06:30".
Since i called DateUtil.setDefaultDisplayTimezone( "+10:00" ), should it be set to the server date?
It looks like the time has been converted to the server timezone, but the date part was not converted.
When the Today button is clicked i need to set the current server time, is there any settings i can set to do that?
Another problem i noticed only in Smartgwt 4.0 is that when you open the date picker again, the selected date go backward 1 day each time its opened.
So if you open the date picker, only change the time and click apply, the date has also changed...
Am i using the DateTimeItem correctly? Is there some settings to correct this behavior?
Thanks.
Tested with SmartGwt 4.0 and 4.1.
Tested on Firefox and Chrome
Here a simple example where i can reproduce the problem.
Code:
public class _gwt_test2 implements EntryPoint {
@Override
public void onModuleLoad() {
HLayout layout = new HLayout( 20 );
DateUtil.setDefaultDisplayTimezone( "+10:00" ); // THIS IS THE SERVER TIMEZONE
DateTimeItem tdi = new DateTimeItem();
tdi.setTitle( "title" );
tdi.setName( "name" );
tdi.setType( "datetime" );
DynamicForm form = new DynamicForm();
form.setFields( tdi );
layout.addMember( form );
layout.draw();
}