You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Yee-wah Lee <ye...@oracle.com> on 2009/10/29 23:35:14 UTC
Re: [jira] Created: (TRINIDAD-1621) dateSelection does select wrong
date when selecting date with daylight-saving time when current date has
no daylight-saving time
Hi Mike,
Could you run the demo for chooseDate or inputDate, and paste the html
source for the 2 Oct 2009 link?
I ran the choosedate demo with your specified scenario, i.e.
- windows timezone = Europe/Berlin
- current date=29 Oct 2009
- trinidad.config xml has time-zone param = Europe/Berlin
I get the following HTML source for the 2 Oct 2009 link:
return _calsd('idp1',1254434400000, 120)
This does not match the values you mentioned. I also tried selecting 2
Oct 2009, and 2 Oct 2009 is populated into the input field, which I
would expect.
Yee-Wah
Mike Toggweiler (JIRA) wrote:
> dateSelection does select wrong date when selecting date with daylight-saving time when current date has no daylight-saving time
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: TRINIDAD-1621
> URL: https://issues.apache.org/jira/browse/TRINIDAD-1621
> Project: MyFaces Trinidad
> Issue Type: Bug
> Affects Versions: 1.2.12-core
> Reporter: Mike Toggweiler
>
>
> The changes made in issue TRINIDAD-1349 aren't working in the case the dateInput is used in the following case:
>
> - assume timezone is set to europe/berlin
> - server and client time-zone are the same (local machine)
> - actual date is the 29. october 2009
> - we'd like to pick a date at the beginning of the month (i.e. 02.10.2009)
> - daylight-saving time was changed at 25.10.2009
> - the resulting date shown in the datefield is set to the 01.10.2009
>
> debugging led me to the following problem:
> The function _dfsv in DateField.js gets called with the selected date in millis (correctly, selecting 02.10.2009 leads to 1251842400000 seconds). The _getLocaleTimeZoneDifference2 evaluates a difference of 1 hour because the selected date is in daylight-saving time, actual date is not. This gets calculated to the new date value which will be reduced to the midnight time and is after calling _dfGetMidnight set to 1251756000000 seonds. But this itself represents the 01.10.2009.
>
> The following workaround fixes the problem:
> - set the time-zone in trinidad-config.xml to GMT, this will eliminate time-zone offsets in selection dialog.
>
> I didn't find a solution to the following question so far:
> why at all will the date/time get adjusted to the local time-zone when selecting a date/time from a dialog? Even if there is a big difference in time-zone I'd like the time to have the value written into the datefield which i have selected, not the value adjusted to the actual server time-zone?
>
>