v1.18.x
Julian Lam 6 years ago
parent c37b2f2ed3
commit c289b904e6

@ -87,18 +87,20 @@ define('admin/settings/email', ['ace/ace', 'admin/settings'], function (ace) {
return app.alertError(err.message);
}
now = new Date(now);
var date = new Date(now.timestamp);
var offset = (new Date().getTimezoneOffset() - now.offset) / 60;
date.setHours(date.getHours() + offset);
$('#serverTime').text(now.toString());
$('#serverTime').text(date.toLocaleTimeString());
now.setHours(parseInt(hour, 10), 0, 0, 0);
date.setHours(parseInt(hour, 10) - offset, 0, 0, 0);
// If adjusted time is in the past, move to next day
if (now.getTime() < Date.now()) {
now.setDate(now.getDate() + 1);
if (date.getTime() < Date.now()) {
date.setDate(date.getDate() + 1);
}
$('#nextDigestTime').text(now.toString());
$('#nextDigestTime').text(date.toLocaleString());
});
}

@ -62,7 +62,12 @@ function leaveCurrentRoom(socket) {
SocketMeta.getServerTime = function (socket, data, callback) {
// Returns server time in milliseconds
callback(null, Date.now());
const now = new Date();
callback(null, {
timestamp: now.getTime(),
offset: now.getTimezoneOffset(),
});
};
module.exports = SocketMeta;

Loading…
Cancel
Save