Lines 3897-3907
sub CalcDateDue {
Link Here
|
3897 |
# starter vars so don't do calculations directly to $datedue |
3897 |
# starter vars so don't do calculations directly to $datedue |
3898 |
my $potential_datedue = $datedue->clone; |
3898 |
my $potential_datedue = $datedue->clone; |
3899 |
my $library_close = $datedue->clone; |
3899 |
my $library_close = $datedue->clone; |
3900 |
my $dayofweek = $datedue->day_of_week - 1; |
3900 |
my $dayofweek = $datedue->day_of_week; |
|
|
3901 |
|
3902 |
# Representation fix |
3903 |
# DateTime object dow (1-7) where Monday is 1 |
3904 |
# Arrays are 0-based where 0 = Sunday, not 7. |
3905 |
if ( $dayofweek == 7 ) { |
3906 |
$dayofweek = 0; |
3907 |
} |
3908 |
|
3901 |
my $tomorrow_dayofweek = $dayofweek + 1; |
3909 |
my $tomorrow_dayofweek = $dayofweek + 1; |
|
|
3910 |
if ( $tomorrow_dayofweek == 7 ) { |
3911 |
$tomorrow_dayofweek = 0; |
3912 |
} |
3902 |
|
3913 |
|
3903 |
# If it's Sunday and tomorrow would be == 7, make tomorrow 0 (Days are stored as 0-6) |
|
|
3904 |
if ( $tomorrow_dayofweek > 6 ) { $tomorrow_dayofweek = 0; } |
3905 |
my $todayhours = Koha::Library::Hours->find( { library_id => $branch, day => $dayofweek } ); |
3914 |
my $todayhours = Koha::Library::Hours->find( { library_id => $branch, day => $dayofweek } ); |
3906 |
my @close = undef; |
3915 |
my @close = undef; |
3907 |
my $tomorrowhours = Koha::Library::Hours->find( { library_id => $branch, day => $tomorrow_dayofweek } ) |
3916 |
my $tomorrowhours = Koha::Library::Hours->find( { library_id => $branch, day => $tomorrow_dayofweek } ) |
3908 |
- |
|
|