You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Lukas Theussl (JIRA)" <ji...@codehaus.org> on 2005/09/08 17:45:03 UTC
[jira] Closed: (MPXDOC-121) Calculation of local time of team member is wrong
[ http://jira.codehaus.org/browse/MPXDOC-121?page=all ]
Lukas Theussl closed MPXDOC-121:
--------------------------------
Cannot reproduce
> Calculation of local time of team member is wrong
> --------------------------------------------------
>
> Key: MPXDOC-121
> URL: http://jira.codehaus.org/browse/MPXDOC-121
> Project: maven-xdoc-plugin
> Type: Bug
> Environment: N/A
> Reporter: Ortwin Glück
> Assignee: Arnaud Heritier
> Priority: Minor
>
> Original Estimate: 15 minutes
> Remaining: 15 minutes
>
> In the POM the Timezone of the developer is defined as an offset to GMT. (This is actually poor, as this does not respect daylight savings. Timezone names should have been preferred.)
> Now, there is JavaScript Code in src/plugin-resources/templates/team-list.xml that calculates the local time of a team member based on that value from the POM and the local time of the user viewing the page.
> Code fragement:
> ----
> function offsetDate(id, offset) {
> var now = new Date() ;
> var nowTime = now.getTime() ;
> var localOffset = now.getTimezoneOffset() ;
> var developerTime = nowTime + (offset * 60 * 60 * 1000) + (localOffset * 60 * 1000) ;
> var developerDate = new Date(developerTime) ;
> document.getElementById(id).innerHTML = developerDate;
> }
> ----
> The code in question is:
> ----
> var developerTime = nowTime + (offset * 60 * 60 * 1000) + (localOffset * 60 * 1000) ;
> ----
> This reads:
> [developerTime] = [local time] + [local timezone offset] + [developer timezone offset]
> which does not make any sense.
> It should rather be:
> [developerTime] = [local time] - [local timezone offset] + [developer timezone offset]
> so the above line should be:
> ----
> var developerTime = nowTime + (offset * 60 * 60 * 1000) - (localOffset * 60 * 1000) ;
> ----
> Kind regards
> Ortwin Glück
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org