From 953419bf011226bcde7920424faa6da2ec8fc92e Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 14 Nov 2021 18:15:19 +0100 Subject: [PATCH] small cleanup around "Last saved:" label * remove old, unused code * String.locale respects the language requested by the integration Signed-off-by: Andras Timar Change-Id: I799856bdd721427e7d58be0a8fcddba866b726ea --- browser/src/map/Map.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/browser/src/map/Map.js b/browser/src/map/Map.js index f5b82a3db..b7e365555 100644 --- a/browser/src/map/Map.js +++ b/browser/src/map/Map.js @@ -414,12 +414,10 @@ L.Map = L.Evented.extend({ if (this.lastModIndicator !== null && this.lastModIndicator !== undefined) { var dateTime = new Date(this._lastmodtime.replace(/,.*/, 'Z')); - var dateValue = dateTime.toLocaleDateString(String.locale, - { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }); + var dateValue; var elapsed = Date.now() - dateTime; - var lang = window.navigator.userLanguage || window.navigator.language; - var rtf1 = new Intl.RelativeTimeFormat(lang, { style: 'narrow' }); + var rtf1 = new Intl.RelativeTimeFormat(String.locale, { style: 'narrow' }); if (elapsed < 60000) { dateValue = _('Last saved:') + ' ' + rtf1.format(-Math.round(elapsed / 1000), 'second'); timeout = 6000;