Message:

   The following issue has been resolved as CANNOT REPRODUCE.

   Resolver: Ortwin Gl�ck
       Date: Thu, 18 Nov 2004 2:01 PM

(new Date()).getTimezonOffset() gets a negative value for positive timezones. 
E.g. it returns -60 in GMT+1. That's why this function is correct.

Resolving the bug.
---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPXDOC-121

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPXDOC-121
    Summary: Calculation of local time of  team member is wrong
       Type: Bug

     Status: Resolved
   Priority: Minor
 Resolution: CANNOT REPRODUCE

 Original Estimate: 15 minutes
 Time Spent: Unknown
  Remaining: 15 minutes

    Project: maven-xdoc-plugin

   Assignee: Arnaud HERITIER
   Reporter: Ortwin Gl�ck

    Created: Fri, 1 Oct 2004 5:31 AM
    Updated: Thu, 18 Nov 2004 2:01 PM
Environment: N/A

Description:
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




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to