The following comment has been added to this issue:
Author: Charlie Dobbie
Created: Wed, 22 Oct 2003 8:20 PM
Body:
I should add that it works for me: WinME, GMT+1, IE5.5 and Mozilla 1.4.
To anyone who wants to try it: generate your site ("maven site"), edit
target/docs/team-list.html and replace the current function with the new one. Then
open the page and check the entries in the "Time" column are correct given the offset
from GMT in "TZ Offset".
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-962
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MAVEN-962
Summary: xdoc-generated team list assumes an offset of -20 from GMT
Type: Bug
Status: Unassigned
Priority: Minor
Time Spent: Unknown
Remaining: Unknown
Project: maven
Components:
plugin-xdoc
Versions:
1.0-beta-10
Assignee:
Reporter: Charlie Dobbie
Created: Wed, 22 Oct 2003 7:57 PM
Updated: Wed, 22 Oct 2003 7:57 PM
Environment: maven-xdoc-plugin-1.4-SNAPSHOT, also exists in current HEAD as of
reporting date
Description:
The xdoc plugin uses velocity:merge to generate a team list from the pom data, using
the plugin-resources\templates\team-list.xml template. This template contains the
following JavaScript:
function offsetDate(id, offset) {
var date = new Date();
var dateOffset = new Date(
Date.UTC(
date.getFullYear(),
date.getMonth(),
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds()
) + (offset - 20) *60*60*1000);
document.getElementById(id).innerHTML = dateOffset;
}
JavaScript isn't my forte, but I believe this code assumes that the time zone offset
given in the pom is going to be -20 offset from the browser's computer's time zone?
After a crash course in JavaScript this evening ;) I think the following may work
better:
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;
}
I *strongly* suggest people give it a go in a few different timezones before applying
it! As I say I'm not a JavaScript guy, and may have totally the wrong end of the
stick.
---------------------------------------------------------------------
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]