[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

Jan Holesovsky kendy at collabora.com
Wed Apr 26 17:36:50 UTC 2017


 loleaflet/src/layer/marker/Annotation.js |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 7784afada43ed47c7cce6c3dabdbdf3ddb7b129e
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Apr 26 19:15:22 2017 +0200

    comments: If we fail to parse the date, show it verbatim.
    
    Change-Id: Iefee7057b3c192c33d49891dd7ef5835d39d1cb8
    Reviewed-on: https://gerrit.libreoffice.org/37000
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js
index 87fd29e9..a7e06a04 100644
--- a/loleaflet/src/layer/marker/Annotation.js
+++ b/loleaflet/src/layer/marker/Annotation.js
@@ -279,12 +279,11 @@ L.Annotation = L.Layer.extend({
 	},
 
 	_updateContent: function () {
-		if (!(this._data.dateTime instanceof Date)) {
-			this._data.dateTime = new Date(this._data.dateTime.replace(/,.*/, 'Z'));
-		}
+		var d = new Date(this._data.dateTime.replace(/,.*/, 'Z'));
+
 		this._contentText.innerHTML = this._nodeModifyText.innerHTML = this._data.text;
 		this._contentAuthor.innerHTML = this._data.author;
-		this._contentDate.innerHTML = this._data.dateTime.toDateString();
+		this._contentDate.innerHTML = isNaN(d.getTime())? this._data.dateTime: d.toDateString();
 		if (this._data.trackchange) {
 			this._captionText.innerHTML = this._data.description;
 		}


More information about the Libreoffice-commits mailing list