The comparison to check the ceilingDueDate is done in the syspref format,
which isn't a good comparison. This changes to code so the comparison is done
using iso format.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
# if ceilingDueDate ON the datedue can't be after the ceiling date
if ( C4::Context->preference('ceilingDueDate')
- && ( C4::Context->preference('ceilingDueDate') =~ C4::Dates->regexp('syspref') )
- && $datedue->output gt C4::Context->preference('ceilingDueDate') ) {
- $datedue = C4::Dates->new( C4::Context->preference('ceilingDueDate') );
+ && ( C4::Context->preference('ceilingDueDate') =~ C4::Dates->regexp('syspref') ) ) {
+ my $ceilingDate = C4::Dates->new( C4::Context->preference('ceilingDueDate') );
+ if ( $datedue->output( 'iso' ) gt $ceilingDate->output( 'iso' ) ) {
+ $datedue = $ceilingDate;
+ }
}
return $datedue;