diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index 354ed3c307..cc71b3926a 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -449,6 +449,20 @@ Koha::Calendar - Object containing a branches calendar =head1 METHODS +=head2 _init + + $calendar->_init(); + +Populates the object with repeatable closed days (weekly and day/month) for the +branch. Called automatically by C. + +=head2 _holidays + + my $holidays = $calendar->_holidays(); + +Returns a hashref of special (one-off) holidays for the branch, keyed by +C date strings. Results are cached. + =head2 new : Create a calendar object my $calendar = Koha::Calendar->new( branchcode => 'MAIN' ); diff --git a/t/db_dependent/Calendar.t b/t/db_dependent/Calendar.t index 0b1c479c3f..0c2ca52165 100755 --- a/t/db_dependent/Calendar.t +++ b/t/db_dependent/Calendar.t @@ -612,7 +612,7 @@ subtest 'hours_between | days_between' => sub { $diff_hours = $calendar->hours_between( $now, $nov_13->clone->subtract( hours => 3 ) )->hours; is( $diff_hours, 8 * 24 - 2 * 24 - 3, 'hours: 289 hours, 2 holidays ' ); $diff_days = $calendar->days_between( $now, $nov_13->clone->subtract( hours => 3 ) )->delta_days; - is( $diff_days, 8 - 1, 'days: 289 hours, 2 holidays' ); + is( $diff_days, 8 - 2, 'days: 289 hours, 2 holidays' ); # Between 5th and 15th $diff_hours = $calendar->hours_between( $now, $nov_15->clone->subtract( hours => 3 ) )->hours;