X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ee1ccfa863b9d56cf7ec987f7fee89c98c484b0b..ae4e9b25b714b02ed7003a21da781fccf9475f38:/underlays/javascript/relativedate.js?ds=sidebyside diff --git a/underlays/javascript/relativedate.js b/underlays/javascript/relativedate.js index 8e05d4065..5142332f1 100644 --- a/underlays/javascript/relativedate.js +++ b/underlays/javascript/relativedate.js @@ -45,6 +45,12 @@ function relativeDate(date) { var offset = date.getTime() - now.getTime(); var seconds = Math.round(Math.abs(offset) / 1000); + // hack to avoid reading just in the future if there is a minor + // amount of clock slip + if (offset >= 0 && seconds < 30 * timeUnits['minute']) { + return "just now"; + } + var ret = ""; var shown = 0; for (i = 0; i < timeUnitOrder.length; i++) {