Lines 33-39
sub _init {
Link Here
|
33 |
); |
33 |
); |
34 |
$weekly_closed_days_sth->execute( $branch ); |
34 |
$weekly_closed_days_sth->execute( $branch ); |
35 |
$self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ]; |
35 |
$self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ]; |
36 |
my $sunday => 7; |
|
|
37 |
while ( my $tuple = $weekly_closed_days_sth->fetchrow_hashref ) { |
36 |
while ( my $tuple = $weekly_closed_days_sth->fetchrow_hashref ) { |
38 |
$self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1; |
37 |
$self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1; |
39 |
} |
38 |
} |
Lines 126-132
sub addDate {
Link Here
|
126 |
|
125 |
|
127 |
if ( $unit eq 'hours' ) { |
126 |
if ( $unit eq 'hours' ) { |
128 |
# Fixed for legacy support. Should be set as a branch parameter |
127 |
# Fixed for legacy support. Should be set as a branch parameter |
129 |
my $return_by_hour => 10; |
128 |
my $return_by_hour = 10; |
130 |
|
129 |
|
131 |
$dt = $self->addHours($startdate, $add_duration, $return_by_hour); |
130 |
$dt = $self->addHours($startdate, $add_duration, $return_by_hour); |
132 |
} else { |
131 |
} else { |
Lines 221-230
sub is_holiday {
Link Here
|
221 |
|
220 |
|
222 |
my $dow = $localdt->day_of_week; |
221 |
my $dow = $localdt->day_of_week; |
223 |
# Representation fix |
222 |
# Representation fix |
224 |
# TODO: Shouldn't we shift the rest of the $dow also? |
223 |
# DateTime object dow (1-7) where Monday is 1 |
225 |
if ( $dow == 7 ) { |
224 |
# Arrays are 0-based where 0 = Sunday. |
226 |
$dow = 0; |
225 |
$dow = $dow % 7; |
227 |
} |
|
|
228 |
|
226 |
|
229 |
if ( $self->{weekly_closed_days}->[$dow] == 1 ) { |
227 |
if ( $self->{weekly_closed_days}->[$dow] == 1 ) { |
230 |
return 1; |
228 |
return 1; |
231 |
- |
|
|