+my ($business_trans_code, $personal_trans_code, $trans_code);
+my $req_date; # requested process date, in %D format
+
+# use Date::Holidays::CA for this?
+#ref http://gocanada.about.com/od/canadatravelplanner/a/canada_holidays.htm
+my %holiday_yearly = (
+ 1 => { map {$_=>1} 1 }, #new year's
+ 7 => { map {$_=>1} 1 }, #canada day
+ 11 => { map {$_=>1} 11 }, #remembrance day
+ 12 => { map {$_=>1} 25 }, #christmas
+ 12 => { map {$_=>1} 26 }, #boxing day
+);
+my %holiday = (
+ 2016 => { 2 => { map {$_=>1} 15 }, #family day
+ 3 => { map {$_=>1} 25 }, #good friday
+ 3 => { map {$_=>1} 28 }, #easter monday
+ 5 => { map {$_=>1} 23 }, #victoria day
+ 8 => { map {$_=>1} 1 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 5 }, #labour day
+ 10 => { map {$_=>1} 10 }, #thanksgiving
+ },
+ 2017 => { 2 => { map {$_=>1} 20 }, #family day
+ 4 => { map {$_=>1} 14 }, #good friday
+ 4 => { map {$_=>1} 17 }, #easter monday
+ 5 => { map {$_=>1} 22 }, #victoria day
+ 8 => { map {$_=>1} 7 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 4 }, #labour day
+ 10 => { map {$_=>1} 9 }, #thanksgiving
+ },
+ 2018 => { 2 => { map {$_=>1} 19 }, #family day
+ 3 => { map {$_=>1} 30 }, #good friday
+ 4 => { map {$_=>1} 2 }, #easter monday
+ 5 => { map {$_=>1} 21 }, #victoria day
+ 8 => { map {$_=>1} 6 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 3 }, #labour day
+ 10 => { map {$_=>1} 8 }, #thanksgiving
+ },
+ 2019 => { 2 => { map {$_=>1} 18 }, #family day
+ 4 => { map {$_=>1} 19 }, #good friday
+ 4 => { map {$_=>1} 22 }, #easter monday
+ 5 => { map {$_=>1} 20 }, #victoria day
+ 8 => { map {$_=>1} 5 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 2 }, #labour day
+ 10 => { map {$_=>1} 14 }, #thanksgiving
+ },
+ 2020 => { 2 => { map {$_=>1} 17 }, #family day
+ 4 => { map {$_=>1} 10 }, #good friday
+ 4 => { map {$_=>1} 13 }, #easter monday
+ 5 => { map {$_=>1} 18 }, #victoria day
+ 8 => { map {$_=>1} 3 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 7 }, #labour day
+ 10 => { map {$_=>1} 12 }, #thanksgiving
+ },
+ 2021 => { 2 => { map {$_=>1} 15 }, #family day
+ 4 => { map {$_=>1} 2 }, #good friday
+ 4 => { map {$_=>1} 5 }, #easter monday
+ 5 => { map {$_=>1} 24 }, #victoria day
+ 8 => { map {$_=>1} 2 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 6 }, #labour day
+ 10 => { map {$_=>1} 11 }, #thanksgiving
+ },
+ 2022 => { 2 => { map {$_=>1} 21 }, #family day
+ 4 => { map {$_=>1} 15 }, #good friday
+ 4 => { map {$_=>1} 18 }, #easter monday
+ 5 => { map {$_=>1} 23 }, #victoria day
+ 8 => { map {$_=>1} 1 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 5 }, #labour day
+ 10 => { map {$_=>1} 10 }, #thanksgiving
+ },
+ 2023 => { 2 => { map {$_=>1} 20 }, #family day
+ 4 => { map {$_=>1} 7 }, #good friday
+ 4 => { map {$_=>1} 10 }, #easter monday
+ 5 => { map {$_=>1} 22 }, #victoria day
+ 8 => { map {$_=>1} 7 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 4 }, #labour day
+ 10 => { map {$_=>1} 9 }, #thanksgiving
+ },
+ 2024 => { 2 => { map {$_=>1} 19 }, #family day
+ 3 => { map {$_=>1} 29 }, #good friday
+ 4 => { map {$_=>1} 1 }, #easter monday
+ 5 => { map {$_=>1} 20 }, #victoria day
+ 8 => { map {$_=>1} 5 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 2 }, #labour day
+ 10 => { map {$_=>1} 14 }, #thanksgiving
+ },
+ 2025 => { 2 => { map {$_=>1} 17 }, #family day
+ 4 => { map {$_=>1} 18 }, #good friday
+ 4 => { map {$_=>1} 21 }, #easter monday
+ 5 => { map {$_=>1} 19 }, #victoria day
+ 8 => { map {$_=>1} 4 }, #First Monday of August Civic Holiday
+ 9 => { map {$_=>1} 1 }, #labour day
+ 10 => { map {$_=>1} 13 }, #thanksgiving
+ },
+);
+
+sub is_holiday {
+ my $dt = shift;
+ return 1 if exists( $holiday_yearly{$dt->month} )
+ and exists( $holiday_yearly{$dt->month}{$dt->day} );
+ return 1 if exists( $holiday{$dt->year} )
+ and exists( $holiday{$dt->year}{$dt->month} )
+ and exists( $holiday{$dt->year}{$dt->month}{$dt->day} );
+ return 0;
+}