Checkout: further validation of due date override user/dbs/bad_dates_are_okay
authorDan Scott <dan@coffeecode.net>
Mon, 8 Oct 2012 19:08:47 +0000 (15:08 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 8 Oct 2012 19:13:00 +0000 (15:13 -0400)
commit4a74564339208ae8bf0eab31a0593e6b628f855c
tree9ccdc14eaaef988972f5febaaded21246997411b
parent5533c9a07dd0c3088de6d868ca3617bae2e4088b
Checkout: further validation of due date override

The check_past() function failed if given a date that was not strictly
in YYYY-mm-dd format; interestingly, a common transposition typo such
as "0212-10-20" results in "212-10-20" getting passed to check_past(),
and therefore generating an invalid date. Throw an exception in
check_past() rather than returning true, because we are not in fact
stating that the due date is in the past - and catch the exception and
flag the due date override box accordingly in the checkout screen.

We could bubble the exception up to the user, but hopefully highlighting
the checkout box as being in an invalid state will catch the attention
of the users.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/xul/staff_client/chrome/content/util/date.js
Open-ILS/xul/staff_client/server/circ/checkout.js