Closed eddielee6 closed 10 years ago
I have updated the PR with your suggestion for enabling strict parsing only for dates. However moment have acknowledged the issue with the date parser and will hopefully resolve it in a future version.
Looking at other pull requests this removes the need for this https://github.com/MakingSense/moment-datepicker/pull/46
Moment.js allows use of an array of date formats when parsing dates.
This means that you can do...
moment('05/05/1945', ['dd/mm/yyyy', 'dd-mm-yyy'])
andmoment('05-05-1945', ['dd/mm/yyyy', 'dd-mm-yyy'])
and both will work. Moment will keep trying the formats in the array until it finds the correct one to parse it with.I have updated the date picker to accept an array for the 'format' parameter. It then uses the first format in the array as the display format.