timrwood/moment — Issue #126: parsing works without format, doesn't with
Author: spmason
Created: 2012-01-11 12:47:43+00:00
State: open

Hi there,

I'm having issues parsing a date with a format string, whereas without the string is works (I can't just parse without the format all the time as I actually need to pass multiple formats and some of those aren't parsed properly)

Examples (run in Chrome, also true in most other browsers I've tried)

moment('May 20, 2011').native().toString()
> "Fri May 20 2011 00:00:00 GMT+0100 (BST)"

moment('May 20, 2011', 'MM DD, YYYY').native().toString()
> "Fri Feb 01 1907 00:00:00 GMT+0000 (GMT)"

moment('May 20, 2011', 'MMM DD, YYYY').native().toString()
> "Fri Jul 01 2067 00:00:00 GMT+0100 (BST)"

moment('May 20, 2011', 'M D, YYYY').native().toString()
> "Fri Feb 01 1907 00:00:00 GMT+0000 (GMT)"

Thanks,
Steve