You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusing interaction between dtstart and exdate #274
I've dug a bit deeper and it's somehow related to the time part of the datetime. If dtstart isn't supplied it defaults to datetime.now(). If I substitute various other times of day for the 05:30 in my example code I get various results that will probably make sense to someone else!
I've been assuming I can ignore the time parts of datetime but there's an interaction that I can't fathom.
What's the correct way to use rrules if one doesn't care about times - only days?
Also, not sure what the unfathomable interactions are about dates and times. If you don't specify anything to do with the time aspects, it will use whatever the time portion of dtstart is. For exrules, the date will only be excluded from the rruleset if it's an exact match, so if you create an exdate of datetime(2016, 12, 27, 17, 30), it won't match a daily recurrence that occurs at 11:42.
If you don't care about the time aspects at all, then you may want to just create a helper function like this:
Then you can either add that in as a wrapper in an rruleset subclass or just apply it to anything you're going to pass to rdate or exdate, and apply it to dtstart as well.
Activity
andybak commentedon Jun 15, 2016
I've dug a bit deeper and it's somehow related to the time part of the datetime. If dtstart isn't supplied it defaults to datetime.now(). If I substitute various other times of day for the 05:30 in my example code I get various results that will probably make sense to someone else!
I've been assuming I can ignore the time parts of datetime but there's an interaction that I can't fathom.
What's the correct way to use rrules if one doesn't care about times - only days?
pganssle commentedon Jun 15, 2016
@andybak I think it's probably a matter of taste what the "correct" way to do it is. I'd personally prefer something like this:
But if you don't want to mess around with setting
dtstart, you can do the same thing by setting thebyhour,byminuteandbysecondparameters:pganssle commentedon Jun 15, 2016
Also, not sure what the unfathomable interactions are about dates and times. If you don't specify anything to do with the time aspects, it will use whatever the time portion of
dtstartis. Forexrules, the date will only be excluded from therrulesetif it's an exact match, so if you create anexdateofdatetime(2016, 12, 27, 17, 30), it won't match a daily recurrence that occurs at 11:42.If you don't care about the time aspects at all, then you may want to just create a helper function like this:
Then you can either add that in as a wrapper in an
rrulesetsubclass or just apply it to anything you're going to pass tordateorexdate, and apply it todtstartas well.