aboutsummaryrefslogtreecommitdiffstats
path: root/t/workingdays.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /t/workingdays.t
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 't/workingdays.t')
-rw-r--r--t/workingdays.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/workingdays.t b/t/workingdays.t
new file mode 100644
index 000000000..326cf05c9
--- /dev/null
+++ b/t/workingdays.t
@@ -0,0 +1,21 @@
+use Test::More;
+use DateTime;
+
+use_ok 'FixMyStreet::WorkingDays';
+
+
+my $wd = FixMyStreet::WorkingDays->new(
+ public_holidays => [
+ '2020-09-21',
+ '2020-09-15',
+ ],
+);
+
+my $dt = DateTime->new(year => 2020, month => 9, day => 19);
+
+is $wd->add_days($dt, 1)->ymd, '2020-09-22';
+is $wd->sub_days($dt, 5)->ymd, '2020-09-11';
+is $wd->is_public_holiday($dt), undef;
+is $wd->is_weekend($dt), 1;
+
+done_testing;