fix server time offset calculation for IE10

This commit is contained in:
Martin Zimmermann 2014-03-28 11:44:03 +01:00
parent e393711859
commit 4fa0f0d8ea
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,10 @@ define(["app/lib/promise", "app/globals"], function(Q, globals) {
function onload() {
globals.offset.update(new Date(xhr.getResponseHeader("Date")));
var date = xhr.getResponseHeader("Date");
if (date !== null) {
globals.offset.update(new Date(date));
}
var cookie = xhr.getResponseHeader("X-Set-Cookie");
if (cookie && cookie.match(/^isso-/)) {

View File

@ -6,7 +6,7 @@ define(function() {
};
Offset.prototype.update = function(remoteTime) {
this.values.push((new Date()).getTime() - remoteTime);
this.values.push((new Date()).getTime() - remoteTime.getTime());
};
Offset.prototype.localTime = function() {