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