inputDate day light saving bug
------------------------------
Key: TRINIDAD-889
URL: https://issues.apache.org/jira/browse/TRINIDAD-889
Project: MyFaces Trinidad
Issue Type: Bug
Components: Components
Affects Versions: 1.0.5-core
Reporter: Thomas Spiegl
JavaScript for inputDate component (DateField.js) adds the day light offset to
the selected date value. This does not work when selecting a date that has a
different day light offset then the actual date.
day light offset is calculated in function _getDayLightSavOffset
var currDate = new Date();
var dstDate = new Date(newValue);
var dlsOffset = dstDate.getTimezoneOffset() - currDate.getTimezoneOffset();
here's an example what happens:
currDate = 9.1.2008 (GMT+1 vienna wintertime)
dstDate = 7.8.2007 (GMT+2 vienna summertime)
dlsOffset = -120- (-60) = -60
==> bug: instead of 7.8.2007, 6.8.2007 will show up in inputDate field, because
1 hour is subtracted from the selected date value
Is there any reason for adding the day light offset to the selected date value?
Wehn skipping day light saving adjustment, the component works fine.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.