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.
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".