}
if ($duedate) {
my $today = $now->clone();
- $today->truncate( to => 'minutes');
+ $today->truncate( to => 'minute');
if (DateTime->compare($duedate,$today) == -1 ) { # duedate cannot be before now
$needsconfirmation{INVALID_DATE} = output_pref($duedate);
}
day => $d,
time_zone => C4::Context->tz,
);
- $expiry_dt->truncate( to => 'days');
- my $today = $now->clone()->truncate(to => 'days');
+ $expiry_dt->truncate( to => 'day');
+ my $today = $now->clone()->truncate(to => 'day');
if (DateTime->compare($today, $expiry_dt) == 1) {
$issuingimpossible{EXPIRED} = 1;
}
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower );
}
- $datedue->truncate( to => 'minutes');
+ $datedue->truncate( to => 'minute');
$sth->execute(
$borrower->{'borrowernumber'}, # borrowernumber
$item->{'itemnumber'}, # itemnumber
my $data = $sth->fetchrow_hashref;
return unless $data;
$data->{issuedate} = dt_from_string($data->{issuedate}, 'sql');
- $data->{issuedate}->truncate(to => 'minutes');
+ $data->{issuedate}->truncate(to => 'minute');
$data->{date_due} = dt_from_string($data->{date_due}, 'sql');
- $data->{date_due}->truncate(to => 'minutes');
- my $dt = DateTime->now( time_zone => C4::Context->tz)->truncate( to => 'minutes');
+ $data->{date_due}->truncate(to => 'minute');
+ my $dt = DateTime->now( time_zone => C4::Context->tz)->truncate( to => 'minute');
$data->{'overdue'} = DateTime->compare($data->{'date_due'}, $dt ) == -1 ? 1 : 0;
return $data;
}
my ( $itemnumber, $history ) = @_;
my $today = DateTime->now( time_zome => C4::Context->tz); # get today date
- $today->truncate( to => 'minutes' );
+ $today->truncate( to => 'minute' );
my $sql = "SELECT * FROM issues
JOIN borrowers USING (borrowernumber)
JOIN items USING (itemnumber)
my $results = $sth->fetchall_arrayref({});
foreach (@$results) {
my $date_due = dt_from_string($_->{date_due},'sql');
- $date_due->truncate( to => 'minutes' );
+ $date_due->truncate( to => 'minute' );
$_->{overdue} = (DateTime->compare($date_due, $today) == -1) ? 1 : 0;
}
if ( $self->{weekly_closed_days}->[$dow] == 1 ) {
return 1;
}
- $dt->truncate( to => 'days' );
+ $dt->truncate( to => 'day' );
my $day = $dt->day;
my $month = $dt->month;
if ( exists $self->{day_month_closed_days}->{$month}->{$day} ) {
sub hours_between {
my ($self, $start_dt, $end_dt) = @_;
my $duration = $end_dt->delta_ms($start_dt);
- $start_dt->truncate( to => 'days' );
- $end_dt->truncate( to => 'days' );
+ $start_dt->truncate( to => 'day' );
+ $end_dt->truncate( to => 'day' );
# NB this is a kludge in that it assumes all days are 24 hours
# However for hourly loans the logic should be expanded to
# take into account open/close times then it would be a duration
my $force_pref = shift; # if testing we want to override Context
if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) {
my $dt = dt_from_string( $str, 'sql' );
- $dt->truncate( to => 'minutes' );
+ $dt->truncate( to => 'minute' );
return output_pref( $dt, $force_pref );
}
return q{};
my $force_pref = shift; # if testing we want to override Context
if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) {
my $dt = dt_from_string( $str, 'sql' );
- $dt->truncate( to => 'minutes' );
+ $dt->truncate( to => 'minute' );
return output_pref_due( $dt, $force_pref );
}
return q{};
}
my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
my $today = DateTime->now( time_zone => C4::Context->tz);
-$today->truncate(to => 'days');
+$today->truncate(to => 'day');
my @borrowers_with_issues;
my $overdues_exist = 0;
my $totalprice = 0;
$row{red} = 1;
}
if ($issuedate) {
- $issuedate->truncate( to => 'days' );
+ $issuedate->truncate( to => 'day' );
if ( DateTime->compare( $issuedate, $today ) == 0 ) {
$row{today} = 1;
}