jquery - JavaScript Date (and Date Time) validation using format parameter -


i found many custom format validation questions , answers, all's format specific hardcoded format. allow set date , datetime format (runtime) "setting" in web application dynamic @ runtime. validate user input against setting:

isvaliddate(userinput, currentsetting) 

the content currentsetting variable example: mm/dd/yyyy

or yyyy.mm.dd hh:mm:ss (for date time)

i not want reinvent wheel, did not found such universal parse/validate method. missed something?

you can use momentjs. provides kind of time/date related functions

http://momentjs.com/


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -