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

Error when trying to get format for "05/07/2015 12:20:15 UTC" #22

Closed darlesson closed 9 years ago

darlesson commented 9 years ago

format.replace(regexFillingWords, '[$1]'))

format.replace is not a function.

gr2m commented 9 years ago

05/07/2015 12:20:15 UTC gets parsed to MM/DD/YYYY H:mm:ss UTC which looks good to me? No idea what format.replace is :)

darlesson commented 9 years ago

Reviewing the errors I was getting, the correct message is "TypeError: 'undefined' is not a function (evaluating 'replaceEndian.bind(null, options)')".

I am using QUnit and running PhantomJS to test proper date format. What happens is that PhantomJS doesn't have Function.prototype.bind.

gr2m commented 9 years ago

Yes, that is a known PhantomJS but though. You have to add a .bind polyfill, or use PhantomJS 2.0

gr2m commented 9 years ago

s/but/bug

darlesson commented 9 years ago

I added an extension for bind. I will close as is.