Closed HipsterBrown closed 8 years ago
awesome thanks @HipsterBrown for the well-explained description, implementation and tests!
Just saw this got merged. :clap:
I'd like to add support for a different month/date format, i.e. "November 29th", next. Just a heads up.
Context: When trying to parse a future date with a month, like today is "20th of November" and the future date being parsed is "9th of December". The returned date from
date.js
would be off by one, i.e. a Date object for the 8th of December.Solution: I added a test for '9th of December 4:00am' and got the same bug I was running into in my own app. To fix this issue, I modified
parser.nextTime
to look for a match with therMonths
regex and not add a day to the date.I hope this makes sense. I appreciate all the work that went into making this awesome library. Thanks for considering this PR.