You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/10/01 11:31:54 UTC

[jira] Created: (MPXDOC-121) Calculation of local time of team member is wrong

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
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: Open
   Priority: Minor

 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: Fri, 1 Oct 2004 5:31 AM
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MPXDOC-121) Calculation of local time of team member is wrong

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ 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


[jira] Resolved: (MPXDOC-121) Calculation of local time of team member is wrong

Posted by ji...@codehaus.org.
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPXDOC-121) Calculation of local time of team member is wrong

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: Arnaud HERITIER
    Created: Tue, 26 Oct 2004 5:42 PM
       Body:
I'm not sure about this.
I never noticed a problem (except that this does not respect daylight savings).
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPXDOC-121?page=comments#action_25804

---------------------------------------------------------------------
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: Open
   Priority: Minor

 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: Tue, 26 Oct 2004 5:42 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org