gr2m / moment-parseformat

A moment.js plugin to extract the format of a date/time string
http://gr2m.github.io/moment-parseformat
Apache License 2.0
45 stars 30 forks source link

01-01-2015 → YYYY-MM-DD #15

Closed rdietrick closed 9 years ago

rdietrick commented 9 years ago

moment.parseFormat('01-01-2015') parsed to YYYY-MM-DD, I expected: MM-DD-YYYY

gr2m commented 9 years ago

wow, what a bad bug, thanks for reporting! I'll look into it

gr2m commented 9 years ago

You can use "/" as a separater instead of "-". That'll work

gr2m commented 9 years ago

fixed via https://github.com/gr2m/moment.parseFormat/commit/5d3230648c41933075d34b49f3ad4c9eed342223

gr2m commented 9 years ago

Sorry, forgot to mention, it now parses to DD-MM-YYYY per default, if you prefer Month first, pass {preferredOrder: 'MDY'}