summaryrefslogtreecommitdiff
path: root/loleaflet/src/core/Socket.js
diff options
context:
space:
mode:
Diffstat (limited to 'loleaflet/src/core/Socket.js')
-rw-r--r--loleaflet/src/core/Socket.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index c4468543b..e5cead41f 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -113,7 +113,9 @@ L.Socket = L.Class.extend({
if (parseInt(this._map.options.docParams.access_token_ttl) - Date.now() <= 0) {
expirymsg = errorMessages.sessionexpired;
}
- var timerepr = $.timeago(parseInt(this._map.options.docParams.access_token_ttl)).replace(' ago', '');
+ var dateTime = new Date(parseInt(this._map.options.docParams.access_token_ttl));
+ var dateOptions = { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' };
+ var timerepr = dateTime.toLocaleDateString(String.locale, dateOptions);
this._map.fire('warn', {msg: expirymsg.replace('%time', timerepr)});
// If user still doesn't refresh the session, warn again periodically