Forum Discussion
Dmitry_Nikolaev
14 years agoStaff
Hi Savitri,
You can use regular expressions for this:
function test()
{
Log.Message(validateDate("35/01/1958"));
Log.Message(validateDate("35/56/1987"));
Log.Message(validateDate("09/30/2010"));
}
function validateDate(dateStr)
{
var reDate = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20\d{2})/;
return reDate.test(dateStr);
}
Related Content
- 11 years ago
- 2 years ago
Recent Discussions
- 2 hours ago