bugs 3912, 4144: can now add contracts if dataformat is not metric
Fixed bug in date validation that prevented adding new contracts
if the dateformat syspref was set to something other than 'metric'.
In process, also removed three hand-written date validation routines
in favor of using JavaScript Date objects and the Date_from_syspref
function provided in calendar.inc.
This fixes bug 3912, and partially addresses bug 4144.