diff options
-rw-r--r-- | cgi/home.cgi | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cgi/home.cgi b/cgi/home.cgi index 422f76e..fdde816 100644 --- a/cgi/home.cgi +++ b/cgi/home.cgi @@ -9,6 +9,15 @@ def next_collection cdate = Time.parse(resp["nextCollection"]) days = ((cdate - Time.now) / (60*60*24)).floor + dayswords = case days + when 0 + "today" + when 1 + "tomorrow" + else + "in #{days} days" + end + case resp["service"] when "REFUSE" "Refuse" @@ -17,7 +26,7 @@ def next_collection when "GARDEN" "<font color=\"brown\">Garden Waste</font>" end + - " needs to go out in #{days} day#{?s if days > 1} for collection on #{cdate.strftime("%A")}." + " needs to go out #{dayswords} for collection on #{cdate.strftime("%A")}." end $page = |