summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2019-02-13 11:04:44 -0400
committerAshod Nakashian <ashnakash@gmail.com>2020-02-26 02:08:29 +0100
commitd622386116376360d679b7c5e4db39598469c4d3 (patch)
treeb7d721cb3f567ca359a579f9ef95f1d41b9fd984
parent8699dc4f9e46f8cf928c16e81f244b2b3f50b565 (diff)
loleaflet: remove jquery.time ago
use Date.toLocaleDateString that returns a string with a language sensitive representation of the date portion of this date Change-Id: Id2e207e5b4d0dbc8d82498567c97105052d70b90 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89111 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r--loleaflet/Makefile.am3
-rw-r--r--loleaflet/src/core/Socket.js4
2 files changed, 4 insertions, 3 deletions
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 258801b0e..d32257ab1 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -102,7 +102,6 @@ NODE_MODULES_JS =\
node_modules/jquery-contextmenu/dist/jquery.contextMenu.js \
node_modules/jquery-ui/jquery-ui.js \
node_modules/smartmenus/dist/jquery.smartmenus.js \
- node_modules/timeago/jquery.timeago.js \
node_modules/timeago.js/dist/timeago.min.js \
node_modules/timeago.js/dist/timeago.locales.min.js \
node_modules/autolinker/dist/Autolinker.js \
@@ -235,7 +234,7 @@ $(builddir)/dist/bundle.js: $(NODE_MODULES_JS_SRC) \
$(builddir)/build/dist/loleaflet-src.js \
$(srcdir)/js/toolbar.js \
$(srcdir)/js/main.js \
- --source-map --output $@
+ --output $@
endif
$(builddir)/dist/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 $(LOLEAFLET_HTML_DST) \
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