CC-3105: Settings dates (the popup select date calendar) shows Today by local machine timezone and not Airtime timezone.

-fixed
This commit is contained in:
Martin Konecny 2011-11-25 17:36:11 -05:00
parent e9c25faa34
commit b1193318ed
7 changed files with 32 additions and 21 deletions

View file

@ -6,3 +6,16 @@ $(document).ready(function() {
savePanelSpace: true
});
});
function adjustDateToServerDate(date, serverTimezoneOffset){
//date object stores time in the browser's localtime. We need to artificially shift
//it to
var timezoneOffset = date.getTimezoneOffset()*60*1000;
date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset*1000);
/* date object has been shifted to artificial UTC time. Now let's
* shift it to the server's timezone */
return date;
}