Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT Date Handing... have client respect server's timezone
    primarykey
    data
    text
    <p>I've read many a post here re: GWT date handling.</p> <p>One in particular that struck a cord with me was this one</p> <p><a href="https://stackoverflow.com/questions/11989219/sending-a-date-and-timezone-from-gae-server-to-gwt-client">Sending a date and timezone from GAE server to GWT client</a></p> <p>Anyhow, there's a need on a project I'm working on to be able to display days, hours, minute intervals as labels in a grid. My team has adopted an approach where all date/time instances are passed the client from the server in ISO8601 String format. The server time zone is to be respected by the client. The biz use case is that all date/time instances are in "market time", so that any browser that visits the app will see and work with dates in the "market time" timezone which happens to be GMT-05:00 (if Daylight Savings in effect) or GMT-06:00 (if Standard Time in effect).</p> <p>I have posted some source on Github, here:</p> <p><a href="https://github.com/fastnsilver/gwt-datehandling-example" rel="nofollow noreferrer">https://github.com/fastnsilver/gwt-datehandling-example</a></p> <p>Particularly...</p> <p><a href="https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/main/java/me/fns/gwt/datehandling/client/util/CSTimeUtil.java" rel="nofollow noreferrer">https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/main/java/me/fns/gwt/datehandling/client/util/CSTimeUtil.java</a></p> <p>and the GWTTestCase</p> <p><a href="https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/test/java/me/fns/gwt/datehandling/client/util/CSTimeUtilTestGwt.java" rel="nofollow noreferrer">https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/test/java/me/fns/gwt/datehandling/client/util/CSTimeUtilTestGwt.java</a></p> <p>in the hopes that someone can stare at the utility (and test) we're employing for date handling and help us see what we're not seeing.</p> <p><strong>EDIT</strong> The basic problem is that <code>CSTimeUtil#hoursInDay(Date)</code> is not being calculated correctly in Production mode for "transition days" This method is used by other methods (like <code>CSTimeUtil#dateToHour(Date)</code> and <code>CSTimeUtil#labelsForDay(Date)</code>).</p> <p>I have deployed our application with the current implementation of <code>CSTimeUtil</code> and it appears to work, but not quite. I'm really confused by alternate test results when e.g., <code>mvn gwt:test</code> is run in GWT Mode or Production Mode on Windows where the OS timezone is set to various timezones other than U.S. <code>GMT-05:00</code> or <code>GMT-06:00</code>. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload