diff options
author | Ezra Epstein <eepstein@users.noreply.github.com> | 2017-07-03 00:45:19 -0700 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-07-03 10:45:19 +0300 |
commit | 7d6408ac56c70c8463856a52d831629d8513625c (patch) | |
tree | 9eff23ce5483029ac7bf9b20f4ec18986527f525 /documentation/getting-started | |
parent | 840e45b5dcc2c55f26d58cc8a6b9a3cf180507c5 (diff) | |
download | vaadin-framework-7d6408ac56c70c8463856a52d831629d8513625c.tar.gz vaadin-framework-7d6408ac56c70c8463856a52d831629d8513625c.zip |
Use ZoneId rather than ZoneOffset for conversion (#9620)
Use ZoneId rather than ZoneOffset for conversion between model (Date) and presentation of LocalDateTime.
LocalDateToDateConverter (correctly) uses ZoneId, whereas LocalDateTimeToDateConverter (incorrectly) used a ZoneOffset. This fix aligns the two Converter implementations and makes the latter one more robust.
A ZoneOffset is a fixed time difference, e.g., +07:00, whereas a time zone - represented by a ZoneId - is more dynamic, including features like Daylight-Savings Time. A ZoneId returns one or more ZoneOffsets via its ZoneRules method. (ZoneOffsets have trivial ZoneRules that simply return the ZoneOffset.)
Since the date/time being displayed may be from any date on the calendar, the ZoneOffset imposes a negative limitation. Using ZoneId instead gets us past that limitation and allows a more robust set of conversion rules.
Fixes #9594
Diffstat (limited to 'documentation/getting-started')
0 files changed, 0 insertions, 0 deletions