dashorst opened a new issue, #1949:
URL: https://github.com/apache/wicket/issues/1949

   `ClientProperties` gets the browser's time zone from 
`wicket-browser-info.js`, which takes the offset on 1 January as standard time 
and the offset on 1 July as daylight saving time. That is right for the 
northern hemisphere only. In Sydney, for example, January is summer time, so 
`utcOffset` and `utcDSTOffset` are swapped and the time zone Wicket derives 
from them is wrong for half the year.
   
   ## Where
   
   
`wicket-core/src/main/java/org/apache/wicket/markup/html/pages/wicket-browser-info.js`:
   
   ```js
   info.utcOffset = (new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 
0).getTimezoneOffset() / -60);
   info.utcDSTOffset = (new Date(new Date().getFullYear(), 6, 1, 0, 0, 0, 
0).getTimezoneOffset() / -60);
   ```
   
   The usual fix: standard time is the smaller of the two UTC offsets (the 
larger `getTimezoneOffset()`), daylight saving time the larger one. Then check 
how `ClientProperties` turns the two values into a `TimeZone`, so the result is 
right in both hemispheres and in zones without daylight saving time.
   
   ## Done when
   
   - `utcOffset` is the standard offset and `utcDSTOffset` the daylight saving 
offset in both hemispheres.
   - Verified with the browser in a southern-hemisphere zone, for example by 
starting it with `TZ=Australia/Sydney`, on the browser info example in 
`wicket-examples` 
(`org.apache.wicket.examples.ajaxhellobrowser.AjaxHelloBrowser`, started from 
`StartExamples` in `wicket-examples/src/test/java`). A QUnit test in 
`wicket-core/src/test/js` is welcome if you can make the offsets testable.
   
   ## Background
   
   Originally reported as 
[WICKET-6572](https://issues.apache.org/jira/browse/WICKET-6572) (Wicket 7.4). 
The Jira ticket links a discussion and the function Apache OpenMeetings used 
for this.
   
   ---
   
   Part of #1945. This issue is meant for a first contribution to Wicket. To 
work on it, leave a comment so others know; a claim without a pull request 
lapses after two weeks. Questions are welcome, here on the issue or on 
[email protected]. Start your branch from `master`, and see [Send a pull 
request to 
Wicket](https://wicket.apache.org/contribute/wicket-pull-request.html) for 
building and testing.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to