Closed keminming closed 9 years ago
I can't reproduce the issue here.
> moment.parseFormat("Thursday, February 6th, 2014 9:20pm")
"dddd, MMMM Do, YYYY h:mma"
> moment().format("dddd, MMMM Do, YYYY h:mma")
"Tuesday, June 24th, 2014 9:41am"
Works as expected for me. Can you provide a code example that leads to an error or wrong behavior?
im using moment.js 2.6 now. the problem moment.isvailid return false for that two input in strict mode. i checked the parse result and find its wrong with Do. the regex in moment.js cant recognize st,rd,nd,th. i dont know if they have new version or solution now. i just modified the regex code. and it works now. On Jun 24, 2014 2:43 AM, "Gregor Martynus" notifications@github.com wrote:
I can't reproduce the issue here.
moment.parseFormat(''Thursday, February 6th, 2014 9:20pm'') "dddd, MMMM Do, YYYY h:mma" moment().format("dddd, MMMM Do, YYYY h:mma") "Tuesday, June 24th, 2014 9:41am"
Works as expected for me. Can you provide a code example that leads to an error or wrong behavior?
— Reply to this email directly or view it on GitHub https://github.com/gr2m/moment.parseFormat/issues/6#issuecomment-46941003 .
Got it. I thought I fixed it myself in https://github.com/moment/moment/pull/1475, but either it has been removed or it doesn't work properly, I'll look into it.
For reference, that's how to reproduce the problem
moment("Thursday, February 6th, 2014 9:20pm", "dddd, MMMM Do, YYYY h:mma", true).format()
// "Invalid date"
ok, cool. i will check it later thank you. On Jun 24, 2014 2:55 AM, "Gregor Martynus" notifications@github.com wrote:
Got it. I thought I fixed it myself in moment/moment#1475 https://github.com/moment/moment/pull/1475, but either it has been removed or it doesn't work properly, I'll look into it.
For reference, that's how to reproduce the problem
moment("Thursday, February 6th, 2014 9:20pm", "dddd, MMMM Do, YYYY h:mma", true).format()// "Invalid date"
— Reply to this email directly or view it on GitHub https://github.com/gr2m/moment.parseFormat/issues/6#issuecomment-46941885 .
It works with latest moment.js (tested with 2.9.0)
Thursday, February 6th, 2014 9:20pm this format is recognized as invalid by moment.js