Bug Fix: Repeating Events (nth weekday of month)

Support for our integrated Contact Manager, Calendar, and Project Tracker.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sat Jan 06, 2007 9:04 am
The Issue

On some cases, creating a repeating event for the nth weekday of month (like the 2nd Tuesday of month) will act as if you asked it to repeat every day for the same duration. (Thanks to Paul Fox for finding this!)

This affects versions of SeedCodeCalendar prior to 3.16.

The Fix

Fortunately this can be easily repaired in your copy of the calendar. You'll have to add a button to one of the mini windows, and then edit one of our scripts.

1. Add a button.

From the daily view, enter layout mode and show the status area using the "Show Status Area" script. Then scroll through the layouts until you arrive at the "Mini Window Show Repeat Options" layout. (Layout no. 71 in the calendar.) Click on the "Monthly" tab of this layout. We need to add a button on top of the little radio button field to the left of "On the 1st..." so that we run a script every time that button is clicked on.

Begin by disallowing entry to that field. Select the field (it is CalRepeatNthOptionGlob) in layout mode and select Format / Field/Control / Behavior from FileMaker's Format menu. Un-check the option that allows entry in browse mode.

Now click over to the "Daily" tab of this layout where there is a button we can copy. If you click on the circkle within the very first radio button on this tab, you'll see that on top of that circle is a small button. Copy that button and then return to the "Monthly" tab and paste it right on top of the radio button field we just disabled.

Double click on this button and you'll see it performs the script "Select Repetition Occurrence...". That is perfect, we just need to change its script parameter. Click "specify" in the Button Setup dialog and you'll see a script parameter at the bottom of the next screen. Change that from "Type = D" to "Type = M".

That's all we have to do to the layout.

2. Edit a script.

Next we'll want to edit the "Select Repetition Occurence ( Type ) { Number }" script. This script is broken down into a number of ElseIf statement and we'll be editing the section beginning with CalendarDaily::CalRepeatTypeGlob = "M"

Immediately after that line, add the following 3 lines:
Code: Select all
If [ IsEmpty ( SeedCode_GetScriptParameter ( "Number" ) ) ]
    Set Field [ CalendarDaily::CalRepeatNthOptionGlob; 2 ]
Else


Finally, add an "End If" a few lines further down, right before the 3 set fields that close out this section. That is, right before this line:
Code: Select all
Set Field [ CalendarDaily::CalRepeatMonthGlob; SeedCode_RemoveExtraReturns ( About::CalRepeatMonthGlob ) ]


That's it!
John Sindelar
SeedCode

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: