If you set a date to repeat until Wednesday, it will actually only repeat until Tuesday.
This creates problems also when people create a weekly event and select the last day, and yet unbeknownst to them the event stops the week before.

If you look at Google Calendar for example and set a repeating date, it repeats through the last day specified.

Comments

karens’s picture

Category: bug » task

This is by design to make the code work the way the ical RRULE standards work, those standards exclude the 'To' date from the results. But I agree this feels odd and non-intuitive. I need to figure out how to make this work intuitively and still have something that matches the standards.

dugh’s picture

Oh ok I understand, thanks for the explanation.

For now I used the string overrides module to replace this string: "Date to stop repeating this item."
with more help about picking the day after the last day of the event.

karens’s picture

I add some text in the widget to make this more clear. I'll leave this open in case anyone has a better solution.

michaek’s picture

do you think storing the day after the selected in the ical RRULE would support the ical standard and provide a better ui? that is, when "sept 1" is selected as the until date, store "sept 2" as the UNTIL. the ui knows that the date stored is always a day later than the last day of the repeat rule (and display "sept 1"), and other standards-observing clients would interpret the ical RRULE correctly. seems like offloading this "make it a day later that the day you intend" process to the user is unneccessary.

karens’s picture

Yes, it would be nice to make this more intuitive, so maybe silently changing the UNTIL date would make sense. But that complicates the code and I don't have time to work on that now. The date validator would have to change the UNTIL date before anything else is done or the processing will not work right. And it must store the 'right' UNTIL date, but always convert it when presented to the user so they see the 'wrong' UNTIL date, so I can see this spiraling into a mess.

So I have mixed feelings.

jesss’s picture

Actually, it appears the Until date *is* included if the frequency is set to every day, which makes the help text a little confusing.

jplarose’s picture

From http://www.kanzaki.com/docs/ical/recur.html

The UNTIL rule part defines a date-time value which bounds the recurrence rule in an inclusive manner. If the value specified by UNTIL is synchronized with the specified recurrence, this date or date-time becomes the last instance of the recurrence. If specified as a date-time value, then it MUST be specified in an UTC time format. If not present, and the COUNT rule part is also not present, the RRULE is considered to repeat forever.

(my emphasis)

This indicates that the UNTIL date is inclusive (like everyone wants), not exclusive (like it's currently implemented).

karens’s picture

Well I like your answer better because I prefer it to work that way, too, but all the examples I found before worked the other way. I'll try to find the links I was using so we can figure out which is right.

karens’s picture

OK, I got all my examples, used to do the tests, from http://www.kanzaki.com/docs/ical/rrule.html, and in those examples the UNTIL dates are excluded. However, I now see that in those examples the start dates are all in Eastern time but the UNTIL dates are in UTC and *that's* why the UNTIL dates are excluded.

I'm happy to be wrong about this, I never liked it working that way but thought it was right. I'll make this change and get it committed later today.

Thanks for pursuing this.

karens’s picture

Status: Active » Fixed

I've removed language saying that the UNTIL date is not included the results and fixed the logic that kept it out. This should be working right now.

karens’s picture

BTW, this part of the code is the same in both D5 and D6, so I fixed it in both places.

jplarose’s picture

Thanks KarenS!

Yeah, I found it weird that they require UNTIL's to be in GMT.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

spython’s picture

Tried the latest 5.x dev, does not seem to work for me.
Do I have to change something else to make it work?

spython’s picture

Status: Closed (fixed) » Active

reopening the issue

robclay’s picture

So will this be an easy fix to make it "inclusive" of last day?

Thanks!

karens’s picture

Status: Active » Fixed

This fix is now committed and the 'Until' date will be included in the results.

robclay’s picture

Thanks! (Drupal would not be nearly as effective for me without this module!)

jlevis’s picture

I am running Date 6.x-2.x-dev (2008-Nov-09) and using the "Text Field with Date Pop-up and Repeat Options" widget to add a date field to a "Program" content type to create program schedules for a community centre web site.

I am finding that the time field for the Repeat Until option isn't autofilling like the others ("Program Schedule From date" and "Program Schedule To date"). If you don't make an effort to click in the box and press an up or down arrow, then it is set to 12:00 AM by default. I found that fact was causing me to miss the last date upon submit. This was because though date was correct, the time ended up being before the last scheduled run time of the program.

Would it be possible to have the time automatically set to 11:59 PM by default?

karens’s picture

#19 is a new and different issue, please file a separate report.

alexjhart’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Status: Fixed » Active

I have an event setup. It starts on a Sunday. I have it set to repeat until Sun Dec 14. It seems like I am experiencing the exclusive behavior described above. I say that because on Dec 14th, the event doesn't show up on the calendar. However, it was my understanding from what I read above that this was changed to be inclusive.

karens’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev
Status: Active » Fixed

This is a fixed 5.2 issue, don't reopen it to report a new 6.2 problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.