Hello,
I am using the following:
GWT 2.4.0
smartgwt 3.0
Firefox 5.0
I want all the date time show in UTC timezone so I set DateUtil.setDefaultDisplayTimezone("+00:00") at the beginnning however, when I click on the date chooser, it still highlights the browser's local date (8/23) and also when I click the today day, it shows 2012/08/23 00:00. The Browser's local time is 8/23/2012 6:57 PM Pacific Time which should be 8/24/2012 01:57 UTC
Here's the very simple test case that has only one start datetime field in the form and does not show the UTC date in the date chooser:
public void onModuleLoad() {
DateUtil.setNormalDateDisplayFormat(DateDisplayFormat.TOSERIALIZEABLEDATE);
DateUtil.setNormalDateDisplayFormatter(new DateDisplayFormatter() {
public String format(Date date) {
if(date == null) return null;
final DateTimeFormat dateFormatter = DateTimeFormat.getFormat(com.sce.adin.sam.client.util.DateUtil.serializeableDateTimeFormatString);
String format = dateFormatter.format(date);
return format;
}
});
DateUtil.setShortDatetimeDisplayFormat(DateDisplayFormat.TOJAPANSHORTDATETIME);
DateUtil.setDefaultDisplayTimezone("+00:00");
DateUtil.setAdjustForDST(false);
final DateTimeItem startDate = new DateTimeItem ("StartDate", "Start Date/Time in UTC");
startDate.setRequired(false);
startDate.setWidth(200);
startDate.setUseTextField(true);
startDate.setEnforceDate(true);
// create form
final DynamicForm form = new DynamicForm();
form.setHeight100();
form.setWidth100();
form.setFields(startDate);
VLayout vLayout = new VLayout();
vLayout.setHeight100();
vLayout.setWidth100();
vLayout.setLayoutAlign(Alignment.RIGHT);
vLayout.setMembers(form);
vLayout.draw();
}
Please help and thank you!
I am using the following:
GWT 2.4.0
smartgwt 3.0
Firefox 5.0
I want all the date time show in UTC timezone so I set DateUtil.setDefaultDisplayTimezone("+00:00") at the beginnning however, when I click on the date chooser, it still highlights the browser's local date (8/23) and also when I click the today day, it shows 2012/08/23 00:00. The Browser's local time is 8/23/2012 6:57 PM Pacific Time which should be 8/24/2012 01:57 UTC
Here's the very simple test case that has only one start datetime field in the form and does not show the UTC date in the date chooser:
public void onModuleLoad() {
DateUtil.setNormalDateDisplayFormat(DateDisplayFormat.TOSERIALIZEABLEDATE);
DateUtil.setNormalDateDisplayFormatter(new DateDisplayFormatter() {
public String format(Date date) {
if(date == null) return null;
final DateTimeFormat dateFormatter = DateTimeFormat.getFormat(com.sce.adin.sam.client.util.DateUtil.serializeableDateTimeFormatString);
String format = dateFormatter.format(date);
return format;
}
});
DateUtil.setShortDatetimeDisplayFormat(DateDisplayFormat.TOJAPANSHORTDATETIME);
DateUtil.setDefaultDisplayTimezone("+00:00");
DateUtil.setAdjustForDST(false);
final DateTimeItem startDate = new DateTimeItem ("StartDate", "Start Date/Time in UTC");
startDate.setRequired(false);
startDate.setWidth(200);
startDate.setUseTextField(true);
startDate.setEnforceDate(true);
// create form
final DynamicForm form = new DynamicForm();
form.setHeight100();
form.setWidth100();
form.setFields(startDate);
VLayout vLayout = new VLayout();
vLayout.setHeight100();
vLayout.setWidth100();
vLayout.setLayoutAlign(Alignment.RIGHT);
vLayout.setMembers(form);
vLayout.draw();
}
Please help and thank you!
Comment