26.09.2011, 06:11
I don't know why people make such functions when all you need is the RegEx plugin and either find the expression online or write it yourself. Date validation is easy in regular expressions.
This will match DD/MM/YYYY OR DD.MM.YYYY OR DD-MM-YYYY OR DD.MM/YYYY
This expression is the same as above except for MM DD YYYY
Код:
^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$
Код:
^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$