w2utils.isDate

Returns true if str is a date.
isDate(str, [format], [returnDateObj])
str string, string to format
format string, optional, format to check
returnDateObj boolean, optional, if true then returns JS Date object
You can specify date format. The format can contain following elements: mm, dd, yyyy, mon in any order with any formatting characters. For example 'mm.dd.yyyy', 'dd-mm-yyyy', 'mon dd, yyyy'. If format is not specified, then the format will be taken from w2utils.settings.dateFormat.
If the third argument format is true, then the method will return JavaScritp Date object is the date is valid

User Comments

comments powered by Disqus