This resolves all remaining significant parts of the bug.
Note that this may have to be revisited for hourly or partial-day circ functionality
for 3.2.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
my ($datedue,$invalidduedate);
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
my ($datedue,$invalidduedate);
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
- $datedue = C4::Dates->new($duedatespec);
+ my $tempdate = C4::Dates->new($duedatespec);
+ if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
+ # i.e., it has to be later than today/now
+ $datedue = $tempdate;
+ } else {
+ $invalidduedate = 1;
+ $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
+ }
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);