SGWTPro-2.5: SC_SNAPSHOT-2011-12-14/Pro Deployment 2011-12-14
I'd like to be able to have all dates in UTC to avoid my application changing times when users access it in different timezones (eg, client time zone setting differs).
This seems like a really common requirement. I wonder what is the best practice suggested by Isomorphic to implement consistent time/date rendering and ignore the client's timezone setting.
Here is a test case. It shows that the FilterEditor and field with different times. When you click to edit the ListGrid record, the editor also shows a different time.
The test time entered is Date(0). I presume that is 0:00 (midnight) at time zone 0:00. The filter editors show this time, however the ListGrid cell render does not.
I'd like to be able to have all dates in UTC to avoid my application changing times when users access it in different timezones (eg, client time zone setting differs).
This seems like a really common requirement. I wonder what is the best practice suggested by Isomorphic to implement consistent time/date rendering and ignore the client's timezone setting.
Here is a test case. It shows that the FilterEditor and field with different times. When you click to edit the ListGrid record, the editor also shows a different time.
The test time entered is Date(0). I presume that is 0:00 (midnight) at time zone 0:00. The filter editors show this time, however the ListGrid cell render does not.
Code:
private void doTest() { DateUtil.setDefaultDisplayTimezone("0:00"); DataSource ds = new DataSource(); ds.setClientOnly(true); DataSourceField timeField = new DataSourceField("time", FieldType.TIME); ds.setFields(timeField); Record testRecord = new Record(); testRecord.setAttribute("time", new Date(0)); ds.setTestData(new Record[] { testRecord }); ListGrid listGrid = new ListGrid(); listGrid.setDataSource(ds); listGrid.setShowFilterEditor(true); Criteria dateCriteria = new Criteria(); dateCriteria.addCriteria("time", new Date(0)); listGrid.fetchData(dateCriteria); listGrid.setCanEdit(true); listGrid.show(); }
Comment