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

Event cloning with monthly interval fails #1580

Closed
OmeGak opened this Issue Aug 19, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@OmeGak
Member

OmeGak commented Aug 19, 2014

# Ticket imported from Trac

Cloning an event with monthly intervals fails when the start date is set to the last day of a month with 31 days. This is caused by the way we iterate months: creating a new date object using the day of start_date. This happens both for Clone the event with a fixed interval and Clone the agenda on given days.

For example:
An event whose repetition starts a 31st October will fail when trying to compose the 31st of November.

The patch should be done using dateutil.rrule in both cases.

For the first type of repetitions we should keep the day of the month unless it doesn't exist for a particular month. In that case we will create the event on the last day of the month. i.e. January 31, February 28, March 31, ...

For the second type of repetitions we should make sure that we don't skip months that don't have 5th weekday and creating the event on the 4th weekday as a fallback. i.e. 5th Sunday of November, 4th Sunday of December, ... 5th Sunday of March.

@OmeGak OmeGak added this to the v2.0 milestone Oct 2, 2014

@ThiefMaster

This comment has been minimized.

Member

ThiefMaster commented Nov 3, 2017

Most likely fixed in 2.0

@meluru

This comment has been minimized.

Contributor

meluru commented Nov 3, 2017

The issue is not fixed for monthly repetition cloning that starts for example at 31st of October, the recurrence in November is ignored, instead of forced to compose last day of month.

According to dateutil.rrule docs: 'recurrence instances falling on invalid dates and times are ignored rather than coerced'

@ThiefMaster ThiefMaster modified the milestones: v2.0, v2.1 Dec 13, 2017

@ThiefMaster

This comment has been minimized.

Member

ThiefMaster commented Dec 13, 2017

@meluru can you add a closes #1580 to your PR so this issue goes away when it's merged?

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