Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

month/day parsing not working #59

brilliantfantastic opened this Issue Aug 7, 2011 · 5 comments


None yet
5 participants

ghost commented Aug 7, 2011

Chronic.parse('8/15') #=> Sun Aug 16 12:00:00 -0400 2015


leejarvis commented Aug 14, 2011

This is intended behaviour, though I agree it's not most common response. Chronic has handlers in place for matching a month/year but not a day/month or month/day, meaning anyone relying on this behaviour will have their libraries break, which of course I'd like to avoid, at least in a patchfix update. Check out the handle_sd_sm branch which will handle '8/15' as the 15th day of the 8th month, or with '8/12', :endian_precedence => :little as the 8th day of the 12th month. I'll build some tests and think when's best to merge this, the handling of month/year can be a fallback when the second operand looks like a year

tbarho commented Nov 16, 2011

Chronic.parse('05/06 at noon') => nil
Chronic.parse('05-06 at noon') => nil

Is this the same issue?

Hi, I'd like to seem month-day implemented for cases such as 8-15. Thanks.

@leejarvis leejarvis pushed a commit that referenced this issue Feb 2, 2012

Lee Jarvis updated changes for #59 4884a57

leejarvis commented Feb 2, 2012

Merged bd9ff2d into master

@leejarvis leejarvis closed this Feb 2, 2012


grantovich commented Mar 7, 2012

The issue @tbarho mentioned seems to still exist. Using the month/day or day/month format while also specifying a time returns nil. Should this be a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment