Comment 18 for bug 1189989

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Kathy, the HTML5 date input element sends YYYY-MM-DD to the server in browsers that support the element.

The text element, which Firefox < 55.0 (for "released" versions of Firefox) treats the date element as, sends whatever the user puts in with no validation. Thus, we'd have to do all kinds of validation on the backend to figure out if it is a date and what format it might be in, which would be impossible for some input dates. Ex. 12/07/17 could Dec. 7, 2017, or July 12, 2017, or July 17, 2012. Even a four digit year leaves you guessing between the first two.

We have at least one other place in the OPAC where we use similar language with a text input element for a date: in the My Account holds list when suspending them. My suggestion is that we wait until Firefox 55.0 is in general release and has been available for a couple of months before we start using the HTML5 date input element. That would likely put that back to Evergreen 3.1 release in the spring of 2018.

My WIP branch (mentioned in a previous comment) does the same thing at the My Account hold suspension code with the date provided by the user. It assumes the MM/DD/YYYY format, and if the data doesn't match that format, then the thaw date is not entered.

A note about Firefox, if you use nightly Firefox builds or the Firefox Developer Edition, then the date input element has been available since release 51.0, but has to be activated from about:config. AFAIK, it has not been available in a general release build of Firefox. The fact that it is enabled by default in the Firefox 55.0 nightly build leads me to believe that it will be enabled in the final Firefox 55.0 general release.

As I mentioned in my previous comment, I also don't want to add a lot of code to check for the user's browser and alter the features that are available or how they are presented. We haven't done that anywhere else in tpac that I can find, and I think it would be a bad precedent.

One final note, we will never have a date input element in the XUL staff client unless we add a JQuery date element.