[WIP] Adding client-side JavaScript validation of date fields

Currently includes commits from the open pull request. The diff will reduce after that is merged.