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 :).
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/CilWiNqcr1YJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.