The ordinal display worked fine in 6.x-2.1 (did not try earlier versions). The date lines were missing entirely for unauthenticated users in all versions (is this normal? Is there some setting I need to change in permissions or some such?).

I re-saved the Event and the Calendar Events View after upgrading to the new dev version, which I did to fix the warning error messages.

Upcoming View modified to show Repeating Date Rule.

Logged-in user sees:

Upcoming Events

  • Repeating Event’s Title
    Repeats every month on the Thursday until Sat Dec 31 2011 .
    Thursday, May 14, 2009 - 5:30pm

(note also the stray space after the year but before the period on the “Repeats” line)

Unauthenticated user sees:

Upcoming Events

  • Repeating Event’s Title

Both should see:

Upcoming Events

  • Repeating Event’s Title
    Repeats every month on the Second Thursday until Sat Dec 31 2011.
    Thursday, May 14, 2009 - 5:30pm

Also, for cosmetic purposes, the hyphen in the long date/time line should be an em dash, but I think I can change this through custom formatting.

One thing that may be causing this: I noted that when I executed the query directly in MySql Query Browser, the “field_date_rrule” field was like this in the earlier version:

RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=2TH;UNTIL=20111231T060000Z;WKST=SU

After upgrading to the dev version and re-saving the Event content data, that field changed slightly:

RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=+2TH;UNTIL=20111231T060000Z;WKST=SU

(Note the addition of the “+”)

P.S. A general comment on these Forums: “Allowed HTML tags” really needs to add “<ins>” to the list, so that we can easily properly notate added text as well as deleted text in displays, field data, etc., using proper content-specific HTML instead of resorting to boldfaced or underscore tags.

CommentFileSizeAuthor
#7 date_repeat_ordinal.patch969 bytesmr. chips
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Joel MMCC’s picture

Issue tags: +repeating, +ordinal

Update: This bug remains after upgrade to Date module Version 6.2-2.2 (May 14th) as well as the 6.2-2.x-dev (May 12th) which I originally reported. I’m not sure if this is caused by Calendar or by Date.

Joel MMCC’s picture

The unauthenticated user not seeing the dates at all was simply due to permissions not having been set for them to see them. Apparently, all CCK fields (not node fields such as Title, Body, etc.) are hidden from everyone except Administrators [or perhaps User/1] by default.

The missing ordinal problem remains an apparent bug. Plus, I just found another one. I’ll submit it as a new Issue.

ericm’s picture

I see this one too. What should be "first Tuesday" is rendered "Tuesday", "second Thursday" is showing "Thursday" etc. The dates are repeating correctly, but the repeat rule statement that's displayed is missing the ordinal.

mr. chips’s picture

I see the missing ordinal too in Date-6.x-2.x-dev from June 9th. That is, 'Repeats every month on the Saturday...' instead of 'Repeats every month on the second Saturday...'.

So in date_repeat.module around line 193 I replaced this:
$results[] = trim(t('!repeats_every_interval on the !date_order !day_of_week', array('!repeats_every_interval ' => '', '!date_order' => strtolower($counts[$count]), '!day_of_week' => $days[$day])));

with this:
$results[] = trim(t('!repeats_every_interval on the !date_order !day_of_week', array('!repeats_every_interval ' => '', '!date_order' => strtolower($counts[substr($byday, 0, 2)]), '!day_of_week' => $days[$day])));

Note that $counts[$count] became $counts[substr($byday, 0, 2)].

I think this only affects the human readable display of the repeat rule. Not sure if what I did is good coding but it seems to work for me, hope this helps.

Joel MMCC’s picture

Status: Active » Needs work

To make Mr. Chip’s patch more readable:

So in date_repeat.module around line 193 I replaced this:
$results[] = trim(t('!repeats_every_interval on the !date_order !day_of_week', array('!repeats_every_interval ' => '', '!date_order' => strtolower($counts[$count]), '!day_of_week' => $days[$day])));

with this:
$results[] = trim(t('!repeats_every_interval on the !date_order !day_of_week', array('!repeats_every_interval ' => '', '!date_order' => strtolower($counts[substr($byday, 0, 2)]), '!day_of_week' => $days[$day])));

Since a proposed patch has been submitted (albeit not in actual *.patch format), I’ve altered the Status to “needs work.”

Mr. Chip, do you know how to make a *.patch? If you do, Attach it, and set Status to “needs review” so that the Test Bot and other users can test it.

mr. chips’s picture

Joel MMCC,

Make a *.patch? No, I'm fairly new to Drupal and my learning curve is still quite flat. Heck, I couldn't even make my post easy to read! (wait, I got it out now)

Do you mean my fix is the 'proposed' patch? I'll see if I can figure out how to make it proper then...

mr. chips’s picture

FileSize
969 bytes

Well, I think I've got it. I made this patch from the directory sites/all/modules/date. Then I applied it to my system and it worked. (Do you sense my surprise?) I used diff to make and apply it, if that matters.

BTW, I think KarenS has done a fantastic job on Calendar and Date!

mr. chips’s picture

Project: Calendar » Date

Doesn't this really belong in the Date project? Not sure if I can move it there or not...

mr. chips’s picture

Status: Needs work » Needs review

Changing to needs review as per Joel MMCC

Joel MMCC’s picture

Component: User interface » Date Repeat API

“BTW, I think KarenS has done a fantastic job on Calendar and Date!”

Agreed!

I had originally put this in “Calendar” since the problem seemed to be a function of the View that makes Event Calendars work, but since you tracked the code down to the Date_Repeat API sub-module, that indeed is the better choice. I also just now assigned the Component accordingly.

pauldawg’s picture

Tried this fix and it seems to work okay. I am subscribing to this.

pauldawg’s picture

I will be putting a new patch up in the next few days which addresses this as well as a few other related quirks in the repeat rule display logic.

pauldawg’s picture

NancyDru’s picture

Status: Needs review » Reviewed & tested by the community

RTBC

jackalope’s picture

I was also having this problem and the patch in #7 fixed it; thanks!

I'm surprised that months later neither this patch nor the larger undertaking in #583192: Improve readability and accuracy of repeat rule display text have been incorporated (I'm using 6.x-2.x-dev)! Any plans for incorporating either/both?

KarenS’s picture

Status: Reviewed & tested by the community » Fixed

Committed #7, thanks!

Status: Fixed » Closed (fixed)
Issue tags: -repeating, -ordinal

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