Lp 1723651: Use HTML5 Date Input Element For Holds in the OPAC
authorJason Stephenson <jason@sigio.com>
Mon, 13 Nov 2017 00:30:17 +0000 (19:30 -0500)
committerJason Stephenson <jason@sigio.com>
Sat, 20 Jan 2018 16:08:48 +0000 (11:08 -0500)
commit3166a8299ca6b31d7d9e9ab3fa02232c94d1da65
tree5b4273ebb24bbaa8ce8e78f031066ff5c13cc159
parentaf4dc462e4f1212dc176a47de3d0074df4614d12
Lp 1723651: Use HTML5 Date Input Element For Holds in the OPAC

We switch from using HTML text input elements to using the new HTML5
date input element in holds forms for the thaw and expire dates.  This
gives us the advantage of accepting dates in the user's native format
and presenting the backend with a date in ISO format.  We can also set
a minimum date for expiration and thaw, which we do with a new TT2
macro, get_tomorrow_date.  This allows us to avoid date validation to
check for dates in he past entered.

We add a check in opac/parts/place_hold.tt2 for the XUL staff client
and allow it to accept dates in the MM/DD/YYYY format because
XULRunner doesn't support the HTML5 date input element.

The expire and thaw date elements still accept dates in the MM/DD/YYYY
format as well as the YYYY-MM-DD format in the event that they degrade
to a text input.  This is, unfortunately, only half-documented for the
XUL staff client user, since we can't really tell from the server if
the user's browser supports the HTML5 date input.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/holds/edit.tt2
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2