From 579021df92e07554ae6854a655c5aca96e6fdc6b Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 16 Jun 2008 12:09:43 -0500 Subject: [PATCH] Bugfix 1978 - on circ, check date specified output is later than now. 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 --- circ/circulation.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 004e7c8b13..0d302bbefb 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -143,7 +143,14 @@ my $newexpiry = $query->param('dateexpiry'); 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); -- 2.39.5