[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loleaflet/Makefile.am loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Wed Feb 26 01:08:47 UTC 2020
loleaflet/Makefile.am | 3 +--
loleaflet/src/core/Socket.js | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)
New commits:
commit d622386116376360d679b7c5e4db39598469c4d3
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Feb 13 11:04:44 2019 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Wed Feb 26 02:08:29 2020 +0100
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 at gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
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
More information about the Libreoffice-commits
mailing list