aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog1
-rw-r--r--underlays/javascript/relativedate.js6
2 files changed, 7 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index ba3042af0..fbfed0007 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ ikiwiki (3.11) UNRELEASED; urgency=low
allowing the admin to see it during wiki setup.
Closes: #520015
* websetup: If setup fails, restore old setup file.
+ * relativedate: Deal with clock skew.
-- Joey Hess <joeyh@debian.org> Tue, 21 Apr 2009 21:41:38 -0400
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++) {