Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'sunday next week' returns nil during certain dates #344

Open
havulinna opened this issue Oct 24, 2016 · 3 comments
Open

'sunday next week' returns nil during certain dates #344

havulinna opened this issue Oct 24, 2016 · 3 comments
Labels

Comments

@havulinna
Copy link

Chronic.parse('sunday next week') appears to return nil when called during the current week. We have not noticed any issues while using it about a year now, but currently Chronic is not able to return sunday for next week.

Chronic.parse('sunday next week', now: Time.parse('2016-10-24 12:00:00 +0200')) # nil

I've tested it by experimenting different times as the now parameter. Calling the method with now set in the past or in the future works as expected:

Chronic.parse('sunday next week', now: Time.parse('2016-10-21 12:00:00 +0200')) # 2016-10-30 11:30:00 +0200
Chronic.parse('sunday next week', now: Time.parse('2016-11-01 12:00:00 +0200')) # 2016-11-13 12:00:00 +0200

I suspect the issue is related to daylight saving time, as our time zone will switch back to standard time on Sunday October 30th.

@davispuh davispuh added the bug label Oct 24, 2016
@davispuh
Copy link
Collaborator

davispuh commented Oct 24, 2016

yup, it is known DST issue #282, #147, #177, #179, #222, #228 and it's actually fixed in my unfinished rewrite branch, but no idea when I'll finish it.

@erunyon
Copy link

erunyon commented Jul 31, 2017

@davispuh Any update on when the rewrite branch will be released? We're running into the DST issue as well.

@davispuh
Copy link
Collaborator

davispuh commented Aug 3, 2017

It's actually been almost finished for really long time (more than a year) I just haven't been working on it for ages. For more info see #316
Anyway I just fixed last tests so now they all pass but it doesn't mean everything is working since there might be cases not covered by tests but they can be fixed once they come up.

# Running:

......................................................................................................

Finished in 11.438857s, 8.9170 runs/s, 67.4893 assertions/s.

102 runs, 772 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to coverage. 3306 / 3528 LOC (93.71%) covered.

You can try and test it already #347

Only thing that's left to do is finish timezone support and then could release beta version. When that will happen no idea, but it could be ~soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants