diff options
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* |