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

Prevent unexpected results with dates lower than 1970 #125

Merged
merged 3 commits into from
Feb 14, 2018

Conversation

polo2ro
Copy link
Contributor

@polo2ro polo2ro commented Jan 23, 2016

Hi,
i have tried to use rrule on this kind of event:

DTSTART;VALUE=DATE:19000101
DTEND;VALUE=DATE:19000102
RRULE:FREQ=YEARLY
SUMMARY:New Year's Day

This does not work because DTSTART is lower than dateutil.ORDINAL_BASE
With this pull request, i have added an exception on the toOrdinal method for dates lower than 1970-1-1
this is usefull because without that the toOrdinal method does not fail and give a very large number, then the fromOrdinal method give back a date greater than 2070 or something similar and the bewteen method give no results.

Note: changing the dateutil.ORDINAL_BASE to a lower date was fixing my problem but i can also change my icalendar source to start from 1970 instead of 1900.

@bradvogel
Copy link

Can this be merged?

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

Successfully merging this pull request may close these issues.

3 participants