GWT's Date object operates just like its JavaScript counterpart in a user's system time zone. Is there a way to override GWT's Date object time zone? Creating something like
public class FakeDate extends Date {
public FakeDate(String timeZoneConstantJson) {
FakeDate.timeZoneConstantJson = timeZoneConstantJson;
TimeZoneInfo timeZoneInfo = TimeZoneInfo.buildTimeZoneData(FakeDate.timeZoneConstantJson);
TimeZone timeZone = TimeZone.createTimeZone(timeZoneInfo);
int currentDateOffsetInMin = timeZone.getOffset(this);
FakeDate.currentDateOffsetInMs = currentDateOffsetInMin * 60 * 1000;
super.setTime(super.getTime() - FakeDate.currentDateOffsetInMs);
}
}
...doesn't work with RequestFactory proxy classes because they expect the Date super class instead of the FakeDate subclass just like the model classes that have a Date field (which has to stay for reasons that would take a while to explain :).