diff options
author | Nat Lasseter <user@4574.co.uk> | 2025-03-10 19:53:58 +0000 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2025-03-10 19:53:58 +0000 |
commit | 3de6054ac74ae013b4509ca5b45d581984027206 (patch) | |
tree | a24c70cef8db07aa54e9bdf8afc8c5ddbdf96db5 /cgi | |
parent | 08eadfbdbd23ea8a60e820728a8da185748e32d8 (diff) |
Even better recycling sentence
Diffstat (limited to 'cgi')
-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 = |