diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-17 18:32:10 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-17 18:32:10 +0100 |
commit | 0e30344f1eedae78a4315c6156c49a674dd3ecc5 (patch) | |
tree | af8c749badbfb2ed97c33b484633b82e7914c1fb /static | |
parent | fd8256beea549a1650cd8fbe1f1d79c7b08a0772 (diff) |
A couple more fixes.
Diffstat (limited to 'static')
-rw-r--r-- | static/javascript/mauve_utils.js | 8 |
1 files changed, 8 insertions, 0 deletions
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* |