Lines 8-14
use DateTime::Set;
Link Here
|
8 |
use DateTime::Duration; |
8 |
use DateTime::Duration; |
9 |
use C4::Context; |
9 |
use C4::Context; |
10 |
use Carp; |
10 |
use Carp; |
11 |
use Readonly; |
|
|
12 |
|
11 |
|
13 |
sub new { |
12 |
sub new { |
14 |
my ( $classname, %options ) = @_; |
13 |
my ( $classname, %options ) = @_; |
Lines 34-40
sub _init {
Link Here
|
34 |
); |
33 |
); |
35 |
$weekly_closed_days_sth->execute( $branch ); |
34 |
$weekly_closed_days_sth->execute( $branch ); |
36 |
$self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ]; |
35 |
$self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ]; |
37 |
Readonly::Scalar my $sunday => 7; |
36 |
my $sunday => 7; |
38 |
while ( my $tuple = $weekly_closed_days_sth->fetchrow_hashref ) { |
37 |
while ( my $tuple = $weekly_closed_days_sth->fetchrow_hashref ) { |
39 |
$self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1; |
38 |
$self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1; |
40 |
} |
39 |
} |
Lines 127-133
sub addDate {
Link Here
|
127 |
|
126 |
|
128 |
if ( $unit eq 'hours' ) { |
127 |
if ( $unit eq 'hours' ) { |
129 |
# Fixed for legacy support. Should be set as a branch parameter |
128 |
# Fixed for legacy support. Should be set as a branch parameter |
130 |
Readonly::Scalar my $return_by_hour => 10; |
129 |
my $return_by_hour => 10; |
131 |
|
130 |
|
132 |
$dt = $self->addHours($startdate, $add_duration, $return_by_hour); |
131 |
$dt = $self->addHours($startdate, $add_duration, $return_by_hour); |
133 |
} else { |
132 |
} else { |
134 |
- |
|
|