aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 18:32:10 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 18:32:10 +0100
commit0e30344f1eedae78a4315c6156c49a674dd3ecc5 (patch)
treeaf8c749badbfb2ed97c33b484633b82e7914c1fb
parentfd8256beea549a1650cd8fbe1f1d79c7b08a0772 (diff)
A couple more fixes.
-rw-r--r--debian/changelog6
-rw-r--r--lib/mauve/web_interface.rb1
-rw-r--r--static/javascript/mauve_utils.js8
3 files changed, 15 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 84a560e..954418b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mauvealert (3.0.5) stable; urgency=low
+
+ * Moar fiXXord.
+
+ -- Patrick J Cherry <patrick@bytemark.co.uk> Fri, 17 Jun 2011 18:08:21 +0100
+
mauvealert (3.0.4) stable; urgency=low
* New release.
diff --git a/lib/mauve/web_interface.rb b/lib/mauve/web_interface.rb
index 520f344..de12291 100644
--- a/lib/mauve/web_interface.rb
+++ b/lib/mauve/web_interface.rb
@@ -231,6 +231,7 @@ EOF
#
# Sanitise parameters
#
+ n_hours = ( n_hours > 300 ? 300 : n_hours )
type_hours = "daytime" unless %w(daytime working wallclock).include?(type_hours)
ack_until = Time.now.in_x_hours(n_hours, type_hours)
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*