Parse n months ago problem #47

Closed
tuo opened this Issue Jun 9, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@tuo

tuo commented Jun 9, 2011

Hi ,
It seems like that Chronic.parse("3 months ago") doesn't use Rails built-in time parse function or like that. It seems like Chronic uses 30 days as a unit to calculate months, which is really not good.
Let's say, i.e:
today is 2011/05/30,
well ,using Chronic.parse("3 months ago") will get 2011/03/02( just minus 90 days) , but obviously it is not what we want.
And if you use Rails built-in time support, "3.months.ago" will get 2011/02/28 which is exactly what we want.

Any thought?

Thanks

@leejarvis

This comment has been minimized.

Show comment
Hide comment
@leejarvis

leejarvis Jun 9, 2011

Collaborator

What version of Chronic are you testing against?

>> Chronic::VERSION
=> "0.4.3"
>> Chronic.parse('3 months ago', :now => Time.local(2011, 5, 30))
=> 2011-02-28 00:00:00 +0000
Collaborator

leejarvis commented Jun 9, 2011

What version of Chronic are you testing against?

>> Chronic::VERSION
=> "0.4.3"
>> Chronic.parse('3 months ago', :now => Time.local(2011, 5, 30))
=> 2011-02-28 00:00:00 +0000
@leejarvis

This comment has been minimized.

Show comment
Hide comment
@leejarvis

leejarvis Jun 11, 2011

Collaborator

I'm going to close this, please re-open if you have a working repro against the latest stable version of Chronic. Thanks!

Collaborator

leejarvis commented Jun 11, 2011

I'm going to close this, please re-open if you have a working repro against the latest stable version of Chronic. Thanks!

@leejarvis leejarvis closed this Jun 11, 2011

@tuo

This comment has been minimized.

Show comment
Hide comment
@tuo

tuo Jun 12, 2011

Sorry for the late reply. It really works! Many thanks!

On Sat, Jun 11, 2011 at 9:41 PM, injekt <
reply@reply.github.com>wrote:

I'm going to close this, please re-open if you have a working repro against
the latest stable version of Chronic. Thanks!

Reply to this email directly or view it on GitHub:
#47 (comment)

tuo commented Jun 12, 2011

Sorry for the late reply. It really works! Many thanks!

On Sat, Jun 11, 2011 at 9:41 PM, injekt <
reply@reply.github.com>wrote:

I'm going to close this, please re-open if you have a working repro against
the latest stable version of Chronic. Thanks!

Reply to this email directly or view it on GitHub:
#47 (comment)

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