Examples - Dates and Time
Date and time formatting and validation can be quite tedious to get right. Spiderscript's SS.datetime.js provides functions
that help simplify the process.
These functions are used in the HTML form validation which can been seen in the validation example.
In the example above, the input date is assumed to be in the format dd/MM/yyyy. This is because the
default locale settings (SS.global.locale.dateformat = "MM/dd/yyyy";) have been overridden to match the settings used in Great Britain. e.g.
SS.global.locale = new SS.locale("gb");. See SS.locale for more information on locale settings.
If the date is input in a different format e.g. MM/dd/yyyy and the value is not ambiguous e.g. 03/15/2008 then the
date parse routine will be able to match this. For ambiguous matches, the default locale value or first match is used.