loleaflet/Makefile.am        |    3 +--
 loleaflet/src/core/Socket.js |    4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d622386116376360d679b7c5e4db39598469c4d3
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Feb 13 11:04:44 2019 -0400
Commit:     Ashod Nakashian <ashnak...@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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <ashnak...@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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to