Date parameter_type with input check

I’m trying to setup a parameter for our operators to use within Foreman (3.1) to set an end date for an exception that gets used by Puppet. When the date passes, Puppet would take actions on that host.

The problem is of course that an open string field date gets entered a dozen different ways, so the thought was it would be great if the interface could enforce a standard format.

  1. Foreman adds a “date” type parameter. In the background this remains a “string” but the interface adds some javascript to enforce a “date” like format during editing.

  2. The “date” format could be selected and/or localized (YYYYMMDD, YYYYDDMM, MMDDYY, DDMMYY, etc).

I have not looked for myself yet to see how hard this task would be, I imagine it would be a bunch of javascript form validation goo.