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
Comments
Post a Comment