From 0e30344f1eedae78a4315c6156c49a674dd3ecc5 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 17 Jun 2011 18:32:10 +0100 Subject: A couple more fixes. --- static/javascript/mauve_utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'static/javascript') diff --git a/static/javascript/mauve_utils.js b/static/javascript/mauve_utils.js index 3012ca3..45a651d 100644 --- a/static/javascript/mauve_utils.js +++ b/static/javascript/mauve_utils.js @@ -13,6 +13,9 @@ function updateDate() { function workoutDate(h, t) { var new_date = null; + h = new Number(h); + h = ( h > 300 ? 300 : h ); + // // Use a synchronous ajax request to fetch the date. Note that // Date.getTime() returns milliseconds.. @@ -29,6 +32,11 @@ function workoutDate(h, t) { function humanDate(d) { var new_date = null; + + if ( d == null ) { + d = new Date(); + } + // // Use a synchronous ajax convert a date to a human string. NB Date.getTime() // returns *milliseconds* -- cgit v1.2.1