Hi,
have a case where the repeat algorithm seems to have missed some dates in the calculation for a repeated Date.
As you can see 10/27/2008, 11/10/2008, 11/24/2008 and others are missing:

Date:
10/13/2008 08:30 - 10:30
Repeats every Monday every week until Mon May 18 2009
10/20/2008 08:30 - 10:30
11/03/2008 08:30 - 10:30
11/17/2008 08:30 - 10:30
12/01/2008 08:30 - 10:30
12/15/2008 08:30 - 10:30
12/29/2008 08:30 - 10:30
01/12/2009 08:30 - 10:30
01/26/2009 08:30 - 10:30
02/09/2009 08:30 - 10:30
02/23/2009 08:30 - 10:30
03/09/2009 08:30 - 10:30
03/23/2009 08:30 - 10:30
04/06/2009 08:30 - 10:30
04/20/2009 08:30 - 10:30
05/04/2009 08:30 - 10:30

Thanks,
Ulf

Comments

ulf1’s picture

I have more news after some debugging into the code. It seems to have something todo with the fact that the week starts Monday on my system and that for weekly recurrences the code jump back and forth in function _date_repeat_calc.

When I enter the recurring date, I do not touch the advanced recurring settings.

Thanks,
Ulf

ulf1’s picture

Priority: Normal » Critical
ulf1’s picture

I now can confirm. I changed my "week start date" from Monday to Saturday and now the calculation is correct and all days are included.

arcane’s picture

I am also having a similar issue:

Repeats the first Sunday and the third Sunday and the fifth Sunday every month until Sun Oct 31 2010
11/02/2008 9:41am
12/07/2008 9:41am
12/21/2008 9:41am
01/04/2009 9:41am
02/01/2009 9:41am
02/15/2009 9:41am
03/01/2009 9:41am
04/05/2009 9:41am
04/19/2009 9:41am
05/03/2009 9:41am
06/07/2009 9:41am
06/21/2009 9:41am
07/05/2009 9:41am
08/02/2009 9:41am
08/16/2009 9:41am
08/30/2009 9:41am
09/06/2009 9:41am
09/20/2009 9:41am
10/04/2009 9:41am
11/01/2009 9:41am
11/15/2009 9:41am
11/29/2009 9:41am
12/06/2009 9:41am

January, March, May, July - all seem to missing repeated dates. It seems to be having this problem for alternating months. Tried setting starting day of week to different days, but it makes no difference.

arcane’s picture

Version: 6.x-2.0-rc3 » 6.x-2.0-rc4

I was using 6.x-2.0-rc4 version of the module.

karens’s picture

Can you look in the database and see exactly what the ical rule says for that date? Is everyone who sees this problem using Monday as the first day of the week?

arcane’s picture

Thanks Karen for getting back to me.

The Ical Rule is:

RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1SU,3SU,5SU;UNTIL=20101031T000000;WKST=SU

Rows in database are:

3 3 0 2008-10-28 08:57:00 NULL
4 4 0 2008-10-29 08:58:00 NULL
6 6 40 2010-10-03 09:41:00
6 6 39 2010-09-19 09:41:00
6 6 38 2010-09-05 09:41:00
6 6 37 2010-08-29 09:41:00
6 6 36 2010-08-15 09:41:00
6 6 35 2010-08-01 09:41:00
6 6 34 2010-07-04 09:41:00
6 6 33 2010-06-20 09:41:00
6 6 32 2010-06-06 09:41:00
6 6 31 2010-05-02 09:41:00
6 6 30 2010-04-18 09:41:00
6 6 29 2010-04-04 09:41:00
6 6 28 2010-03-07 09:41:00
6 6 27 2010-02-21 09:41:00
6 6 26 2010-02-07 09:41:00
6 6 25 2010-01-03 09:41:00
6 6 24 2009-12-20 09:41:00
6 6 23 2009-12-06 09:41:00
6 6 22 2009-11-29 09:41:00
6 6 21 2009-11-15 09:41:00
6 6 20 2009-11-01 09:41:00
6 6 19 2009-10-04 09:41:00
6 6 18 2009-09-20 09:41:00
6 6 17 2009-09-06 09:41:00
6 6 16 2009-08-30 09:41:00
6 6 15 2009-08-16 09:41:00
6 6 14 2009-08-02 09:41:00
6 6 13 2009-07-05 09:41:00
6 6 12 2009-06-21 09:41:00
6 6 11 2009-06-07 09:41:00
6 6 10 2009-05-03 09:41:00
6 6 9 2009-04-19 09:41:00
6 6 8 2009-04-05 09:41:00
6 6 7 2009-03-01 09:41:00
6 6 6 2009-02-15 09:41:00
6 6 5 2009-02-01 09:41:00
6 6 4 2009-01-04 09:41:00
6 6 1 2008-11-02 09:41:00
6 6 2 2008-12-07 09:41:00
6 6 3 2008-12-21 09:41:00
6 6 0 2008-10-28 09:41:00 RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1SU,3SU,5SU;UN...

I have the following Date and Time Settings:
Default Time Zone: America/New_York
User Configurable Time Zones: Disabled (Didn't make a difference what I set to)
First Day of Week: Sunday (Didn't make a difference what I set to)

I am trying to set up Eclipse with debugging so I can step through the code, but haven't been fully successful yet in setting breakpoints in modules. Please let me know if I can do anything else to help track down the problem.

karens’s picture

This is very helpful. I can see you're repeating on Sunday, the first day of the week, you are searching for more than one match for that day, and you are including a search for the 5th Sunday, which does not always exist. I can just look at that and see that there is potential for misses :)

And I can replicate the problem, which means I can now debug it, so I'll work on that now.

To the others, I need to know if that is the same pattern that is failing for you. I suspect a bug in one or more of the following patterns:

* a date that repeats on the first day of the your week, whatever day is the first day of your week,
* a bug when searching for multiple matches on that day (like the 1st and 3rd),
* or a bug when searching for the 5th occurrence when there is not always a 5th occurrence.

karens’s picture

I found arcane's problem and fixed it. When searching for things like 'the 5th Sunday', in months without a 5th Sunday it jumped ahead to the next month prematurely, causing the next month to get skipped. That fix is in cvs and will hit the -dev version of the tarball tonight.

Now I'm going to see if I can find ulf1's problem. The code that looks for 'every' Monday is a different than the code that looks for the '1st' Sunday, so it may need a different fix.

arcane’s picture

Thanks Karen,

Looking forward to testing the new build

karens’s picture

Status: Active » Fixed

@ulf1, what version of PHP are you using? I can replicate your problem when using a PHP version less than PHP 5.2, but everything works correctly in PHP 5.2+. I found a bug in the PHP4 module's computation of the first day of the week when the week starts on Monday and committed a fix for that. With that change I think all the problems in this thread are fixed.

laken’s picture

subscribing

arcane’s picture

I can verify that this fixed the problem for me. Thanks Karen!!

ctmiller’s picture

Karen. Thanks for getting the date repeat working in views. That was huge for the church site I am working on. In the latest nightly downloaded today i get this issue for the first time. The date skips as mentioned above. I am using Sunday as the start date for the week. You can see the skips below. Almost looks like its doing every two weeks for a weekly repeat.

Repeats every Sunday every week until Sat Dec 31 2011
When:
Nov 9 2008 9:45am - 10:45am
When:
Nov 23 2008 9:45am - 10:45am
When:
Dec 7 2008 9:45am - 10:45am
When:
Dec 21 2008 9:45am - 10:45am
When:
Jan 4 2009 9:45am - 10:45am
When:
Jan 18 2009 9:45am - 10:45am
When:
Feb 1 2009 9:45am - 10:45am
When:
Feb 15 2009 9:45am - 10:45am
When:
Mar 1 2009 9:45am - 10:45am
When:
Mar 15 2009 9:45am - 10:45am
When:
Mar 29 2009 9:45am - 10:45am
When:
Apr 12 2009 9:45am - 10:45am
When:
Apr 26 2009 9:45am - 10:45am
When:
May 10 2009 9:45am - 10:45am
When:
May 24 2009 9:45am - 10:45am
When:
Jun 7 2009 9:45am - 10:45am
When:
Jun 21 2009 9:45am - 10:45am
When:
Jul 5 2009 9:45am - 10:45am
When:
Jul 19 2009 9:45am - 10:45am
When:
Aug 2 2009 9:45am - 10:45am
When:
Aug 16 2009 9:45am - 10:45am
When:
Aug 30 2009 9:45am - 10:45am
When:
Sep 13 2009 9:45am - 10:45am
When:
Sep 27 2009 9:45am - 10:45am
When:
Oct 11 2009 9:45am - 10:45am
When:
Oct 25 2009 9:45am - 10:45am
When:
Nov 8 2009 9:45am - 10:45am
When:
Nov 22 2009 9:45am - 10:45am
When:
Dec 6 2009 9:45am - 10:45am
When:
Dec 20 2009 9:45am - 10:45am
When:
Jan 3 2010 9:45am - 10:45am
When:
Jan 17 2010 9:45am - 10:45am
When:
Jan 31 2010 9:45am - 10:45am
When:
Feb 14 2010 9:45am - 10:45am
When:
Feb 28 2010 9:45am - 10:45am
When:
Mar 14 2010 9:45am - 10:45am
When:
Mar 28 2010 9:45am - 10:45am
When:
Apr 11 2010 9:45am - 10:45am
When:
Apr 25 2010 9:45am - 10:45am
When:
May 9 2010 9:45am - 10:45am
When:
May 23 2010 9:45am - 10:45am
When:
Jun 6 2010 9:45am - 10:45am
When:
Jun 20 2010 9:45am - 10:45am
When:
Jul 4 2010 9:45am - 10:45am
When:
Jul 18 2010 9:45am - 10:45am
When:
Aug 1 2010 9:45am - 10:45am
When:
Aug 15 2010 9:45am - 10:45am
When:
Aug 29 2010 9:45am - 10:45am
When:
Sep 12 2010 9:45am - 10:45am
When:
Sep 26 2010 9:45am - 10:45am
When:
Oct 10 2010 9:45am - 10:45am
When:
Oct 24 2010 9:45am - 10:45am
When:
Nov 7 2010 9:45am - 10:45am
When:
Nov 21 2010 9:45am - 10:45am
When:
Dec 5 2010 9:45am - 10:45am
When:
Dec 19 2010 9:45am - 10:45am
When:
Jan 2 2011 9:45am - 10:45am
When:
Jan 16 2011 9:45am - 10:45am
When:
Jan 30 2011 9:45am - 10:45am
When:
Feb 13 2011 9:45am - 10:45am
When:
Feb 27 2011 9:45am - 10:45am
When:
Mar 13 2011 9:45am - 10:45am
When:
Mar 27 2011 9:45am - 10:45am
When:
Apr 10 2011 9:45am - 10:45am
When:
Apr 24 2011 9:45am - 10:45am
When:
May 8 2011 9:45am - 10:45am
When:
May 22 2011 9:45am - 10:45am
When:
Jun 5 2011 9:45am - 10:45am
When:
Jun 19 2011 9:45am - 10:45am
When:
Jul 3 2011 9:45am - 10:45am
When:
Jul 17 2011 9:45am - 10:45am
When:
Jul 31 2011 9:45am - 10:45am
When:
Aug 14 2011 9:45am - 10:45am
When:
Aug 28 2011 9:45am - 10:45am
When:
Sep 11 2011 9:45am - 10:45am
When:
Sep 25 2011 9:45am - 10:45am
When:
Oct 9 2011 9:45am - 10:45am
When:
Oct 23 2011 9:45am - 10:45am
When:
Nov 6 2011 9:45am - 10:45am
When:
Nov 20 2011 9:45am - 10:45am
When:
Dec 4 2011 9:45am - 10:45am
When:
Dec 18 2011 9:45am - 10:45am

karens’s picture

Many of the fixes didn't go in until this morning, so you probably don't have them yet. The tarball won't have them until the next time it is packaged, midnight UTC. I was seeing the skipped weeks, too and committed some fixes.

ctmiller’s picture

This is fixed with the latest update. Also noticed the speed is much better on date repeats and I'm not getting any of the server timeouts when using repeats longer than a year.

ulf1’s picture

Hi KarenS,

sorry for replying late. I used PHP 4.4.7.
I will give the latest build a try.

Thanks,
Ulf

Status: Fixed » Closed (fixed)

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