strptime in Javascript

mpeters picture mpeters · Jan 26, 2009 · Viewed 9.6k times · Source

I have a date input field that allows the user to enter in a date and I need to validate this input (I already have server side validation), but the trick is that the format is locale dependent. I already have a system for translating the strptime format string to the the user's preference and I would like to use this same format for validating on the Javascript side.

Any ideas or links to a strptime() implementation in Javascript?

Answer

mpeters picture mpeters · Jan 29, 2009

After a few days of googling I found this implementation which, although not complete, seems to handle all of the cases I have right now.