aboutsummaryrefslogtreecommitdiffstats
path: root/t/utils.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2017-01-03 17:14:11 +0000
committerMatthew Somerville <matthew@mysociety.org>2017-01-03 17:14:11 +0000
commit0a5a8430025555ffef822345a4dc1f4474ef37b7 (patch)
tree9f3c8f1e9beb98dccb2434865a7a6ef00ddad607 /t/utils.t
parentcdaef42de3a3fe84b7764dc797a2f146dbe9d0be (diff)
Fix bad cross-year test.
Make sure the tested date is in the same year as current.
Diffstat (limited to 't/utils.t')
-rw-r--r--t/utils.t6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/utils.t b/t/utils.t
index ac9eb1a4a..d6c56d95a 100644
--- a/t/utils.t
+++ b/t/utils.t
@@ -78,7 +78,11 @@ if ($dt->day_of_week == 7) { # Sunday
}
is Utils::prettify_dt($dt), $dt->strftime("%H:%M, %A");
-$dt = DateTime->now->subtract(days => 100);
+if ($dt->month == 1) { # January
+ $dt = DateTime->now->add(days => 30);
+} else {
+ $dt = DateTime->now->subtract(days => 30);
+}
is Utils::prettify_dt($dt), $dt->strftime("%H:%M, %A %e %B %Y");
is Utils::prettify_dt($dt, "date"), $dt->strftime("%A %e %B %Y");
is Utils::prettify_dt($dt, "zurich"), $dt->strftime("%H:%M, %e. %B %Y");