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

stops() skips february??? #99

Closed
gordol opened this issue Jun 30, 2017 · 2 comments
Closed

stops() skips february??? #99

gordol opened this issue Jun 30, 2017 · 2 comments

Comments

@gordol
Copy link

gordol commented Jun 30, 2017

>>> import delorean
>>> import datetime
>>> end = datetime.datetime.today()
>>> start = end - datetime.timedelta(days=365)
>>> for stop in delorean.stops(freq=delorean.MONTHLY, count=12, timezone="US/Eastern", start=start, stop=end):
...   print "%s - %s" % (stop.datetime.year, stop.datetime.month)
...
2016 - 6
2016 - 7
2016 - 8
2016 - 9
2016 - 10
2016 - 11
2016 - 12
2017 - 1
2017 - 3
2017 - 4
2017 - 5
2017 - 6
>>>
@gordol
Copy link
Author

gordol commented Jun 30, 2017

Yep...

This is a bug in dateutil.

🤦‍♂️

>>> [x for x in rrule(MONTHLY, count=12, dtstart=datetime(2016,1,30))]
[datetime.datetime(2016, 1, 30, 0, 0), datetime.datetime(2016, 3, 30, 0, 0), datetime.datetime(2016, 4, 30, 0, 0), datetime.datetime(2016, 5, 30, 0, 0), datetime.datetime(2016, 6, 30, 0, 0), datetime.datetime(2016, 7, 30, 0, 0), datetime.datetime(2016, 8, 30, 0, 0), datetime.datetime(2016, 9, 30, 0, 0), datetime.datetime(2016, 10, 30, 0, 0), datetime.datetime(2016, 11, 30, 0, 0), datetime.datetime(2016, 12, 30, 0, 0), datetime.datetime(2017, 1, 30, 0, 0)]

It indeed skips right over february :(

@gordol
Copy link
Author

gordol commented Jun 30, 2017

dateutil/dateutil#149

@gordol gordol closed this as completed Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant