mojombo / chronic

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

Parsing 'first this month' on 2/29 outputs 3/1 #327

Open seanysun opened 8 years ago

seanysun commented 8 years ago

Parsing 'first this month' on 2/29 outputs 3/1

[9] pry(main)> Time.now
=> 2016-02-29 14:39:04 -0800
[10] pry(main)> Chronic.parse('first this month')
=> 2016-03-01 12:00:00 -0800

I'd be happy to put together a PR to fix this, but I noticed that no PR's have been merged since 2014. If I submit a fix, is there any chance it will be accepted?

davispuh commented 8 years ago

I think this format isn't really supported... and see #316, if you want to make PR do it for my rewrite branch, it's still work in progress and not finished but I'll work on it when I'll have time.

EDIT: actually it seems to be working, but you need to use :context => :past

frank184 commented 7 years ago

I've noticed this in a project today.

We're Sept 30, 2016 and doing Chronic.parse('this month') returns Oct 1st, 2016.

I would expect 'this month' to be the month that we're currently in...