Page 1 of 1

Issue with monthly repeating events

PostPosted: Fri Aug 23, 2013 9:35 am
by jchunter
We are running Calendar 5.6.2 and have encountered an issue with monthly repeating events.

If you open the Event Details layout to create a new event, click the "repeat" button, then the "Monthly" tab, enter the repeat period (e.g. 6 months), choose a start date (e.g. the 1st), stop after the desired number of repetitions or stop date and click "continue" you get a monthly repeating event. In fact no matter what number you put in the repeat-every-x-months field you get an every-month-repeat (although the correct number of events). However if you use the option of "On the 1st, 2nd, 3rd, etc / Monday, Tuesday, Wednesday etc" option then it recognizes the every-x-months number and you get your 6-monthly or whatever was chosen event gap.

Can anybody else replicate this issue or am I doing something wrong?

Thanks.

Re: Issue with monthly repeating events

PostPosted: Mon Aug 26, 2013 12:32 pm
by jeffalmquist
I think you're onto something here. I just tried this myself and saw the same result. In fact the same thing happens in the FM 12 version of the calendar. We'll come up with a fix and post that ASAP. Thanks for reporting this!

Re: Issue with monthly repeating events

PostPosted: Mon Aug 26, 2013 1:25 pm
by jchunter
Thanks for the confirmation - it's good to know I'm not going crazy, well at least not crazy due to Calendar!

Re: Issue with monthly repeating events

PostPosted: Tue Aug 27, 2013 9:52 am
by jeffalmquist
Here's how you can fix this behavior in your file. In the "Build Repetition List ( Repeat_StartDate ; Repeat_Rule )" script, you need to adjust two Set Variable calculations. I'm attaching screen shots to show you where all of this needs to happen and what it needs to look like. I'm also pasting the code for one of the edits so you can just copy/paste it into your file:

// Need to account for possibility of month advancement going too far, i.e. 11/31/2011 = 12/1/2011
Let ( [
dt = $sc_Repeat_NextDate;
i = $sc_UseInterval ;
mnth = Month ( dt ) ;
dy = Day ( dt ) ;
yr = Year ( dt ) ;
newdate = Date ( mnth + i ; dy ; yr ) ;
newmnth = Month ( newdate ) ;
newyr = Year ( newdate ) ;
newmnthyr = If ( ( newyr > yr ) ; newmnth + 12 ; newmnth ) ; //adjust month if spanning new year
dy = If ( ( newmnthyr - mnth ) > i; 0 ; dy ) //If we've gone too far then set dy to 0 for last day of previous month.
] ;
Date ( newmnth ; dy ; newyr )
) ;

Re: Issue with monthly repeating events

PostPosted: Tue Aug 27, 2013 4:08 pm
by jchunter
Thank you for the quick reply but unfortunately we're not quite there yet.

I located the script and first variable edit (the one with the large copy-and-paste change) with no problem and made the update. However the second edit you specified in the same script already had

If ( n= 1 ; 0 ; 1 ) // If ( n= 1 ; 0 ; $sc_UseInterval )
for
$sc_ThisBYMONTHDAY
so there was no change to be made.

This is for the FMP 11 version. The single edit I made did not fix the problem, most likely because I was not able to make the second edit. Did you perhaps make a different second edit?

Thanks.

Re: Issue with monthly repeating events

PostPosted: Wed Aug 28, 2013 6:26 pm
by jeffalmquist
I'm VERY sorry. The mistake was that my second instruction wasn't clear at all. You need to DELETE the code you see highlighted in that screenshot, so the Set Variable value should look like this new screen shot. Give that a try and let me know if it works.

Re: Issue with monthly repeating events

PostPosted: Thu Aug 29, 2013 1:31 pm
by jchunter
Success!

Yes, I was confused by your instruction for the second edit but the clarification helped and we can now create multiple events at n-monthly intervals.

Many thanks for your help.

Re: Issue with monthly repeating events

PostPosted: Thu Aug 29, 2013 2:17 pm
by jeffalmquist
Awesome. That's great to hear. Thanks for the feedback. :)