My understanding is that you can do this on the client side if you only need to edit in the timezone of the browser. The problem I had was that my users have a timezone preference that can be different than the browser and the browser doesn't provide access to every timezone. Because the timezone offset varies based on the Date and daylight savings on that Date (e.g. EDT -0400 vs EST -0500), I wasn't able to ensure that I was using the right offset for a given Date in the user's preferred timezone.
If you dig through the implementation of the gwt DateTimeFormat, emul Date, JsDate, etc. Date.getTimezoneOffset is provided by the browser in the timezone of the browser. There's no way to ask for the timezone offset of a date in an arbitrary timezone. If I missed something, I'd love to be corrected. On Thursday, September 13, 2012 7:48:38 AM UTC-4, Andrei wrote: > > You don't need a TimeZone for parsing dates, as you observed in your post. > I also had to implement my own box for parsing time, because I want my > users to be able to enter time in any format they like (2pm, 2:00 PM, > 2:00p, 14:00). Then I adjust the raw time (in milliseconds) using time > zone's offset. And I do store all dates and times as Longs. > > Basically, this is the same idea, but adjustments are made on the client > side. I like your approach, though. > -- 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/-/A9wOH-X4uccJ. 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.
