From c819aaf71609f57b523d5756015f80d92315e738 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 2 Feb 2019 10:34:50 +0100 Subject: [PATCH] Fix -1 year ago issue --- assets/js/common/date.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/common/date.js b/assets/js/common/date.js index 3183599e..f1d8b8d9 100644 --- a/assets/js/common/date.js +++ b/assets/js/common/date.js @@ -21,6 +21,11 @@ ComunicWeb.common.date = { * @return {String} The generated date */ diffToStr: function(difference){ + + //Check if difference is less than one second + if(difference < 0) + difference = 0; + //Calculate seconds var seconds = difference-Math.floor(difference/60)*60; var difference = (difference - seconds)/60;