mojombo / chronic

Chronic is a pure Ruby natural language date parser.
http://injekt.github.com/chronic
MIT License
3.24k stars 461 forks source link

"Last Saturday in March" not parsed #237

Open mwlang opened 10 years ago

mwlang commented 10 years ago

"First Saturday in March" => 2014-03-01 12:00:00 -0500

"Last Saturday in March" => nil

Also,

"First Saturday next March" => 2014-03-01 12:00:00 -0500 "First Saturday last March" => 2013-03-01 12:00:00 -0500

But,

"First Saturday in March of next year" => nil "First Saturday in March 2015" => nil "First Saturday of March 2015" => nil "First Saturday in March of 2015" => nil

davispuh commented 10 years ago

"Last Saturday in March" is just not supported format by Chronic as it doesn't recognize "Last" and those other formats aren't really either, it's more of a luck that some work.

If you need such feature, you could try debug and implement it.

mwlang commented 10 years ago

I will take a look at the code and see how hard it is to implement...mostly looking to be able to easily figure out a holday's date either in current year or upcoming year. For example, Father's Day occurring on "3rd Sunday of June" (which worked), and Memorial Day, "Last Monday in May" (which didn't). And of course, do it for current year as well as any specified year (as illustrated above).