Always use UTC for watchdog timestamps

Forcing UTC will ensure that offset calculation is always correct
This commit is contained in:
Łukasz Mierzwa
2017-03-31 23:48:49 -07:00
parent 7e8dc0c0ff
commit 4b4c3971b8
2 changed files with 3 additions and 3 deletions

View File

@@ -130,7 +130,7 @@ var Unsee = (function(params) {
Colors.Update(resp['colors']);
Alerts.Update(resp);
updateCompleted();
Watchdog.Pong(moment(resp['timestamp']).unix());
Watchdog.Pong(moment(resp['timestamp']);
Unsee.WaitForNextReload();
$(selectors.errors).html('');
$(selectors.errors).hide('');

View File

@@ -21,7 +21,7 @@ var Watchdog = (function() {
// don't raise an error if autorefresh is disabled
if (!Config.GetOption('autorefresh').Get()) return;
var now = moment().unix();
var now = moment().utc().unix();
if (now - lastTs > maxLag) {
Grid.Clear();
$('#errors').html(haml.compileHaml('fatal-error')({
@@ -55,7 +55,7 @@ var Watchdog = (function() {
updateTs = function(ts) {
lastTs = ts;
lastTs = ts.utc().unix();
}