Bug Fix: CC Calendar

Questions and suggestions for the CC Calendar product.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Fri Dec 12, 2003 5:59 am
New Version

We have a new version (4.51) of CC Calendar available to address a bug in the display of months which begin on Monday when the calendar is set to "start week on Monday". We apologize for any inconvenience this may cause.

Below you'll find instructions for downloading a new copy of the Free Version, or requesting a new copy of the Pro Version. You'll also find out how to reproduce the bug so you can see if this is something you want to mess with at all.

Finally, if you've made extensive modifications to your calendar, we're offering to make the repairs on your modified copy at no charge. Just email us for details: [email protected] (You must be using the latest version of the calendar- the one which contains the "start week on Monday" option.)

Special thanks to Rick Rowland for help in debugging this.

All the best,

John Sindelar

________________________________________________

Download a new Free Version

Download a new free version here:
http://www.seedcode.com/lists/?p=subscribe&id=2
________________________________________________

Request a new Pro Version

If you'd like a fresh copy of CC Calendar Pro Version, please email us a request at [email protected] Please use or include the original email address you used to purchase the product. If you bought the calendar at DevCon and did not provide us with an email address, just include your full name and your phone number.

________________________________________________

Reproduce the Bug

From the About tab, click on Settings and check the box that says "start week on Monday". Move to the Daily View in CC Calendar. Navigate to December 2004. Select any Day in December in the Daily View's mini Calendar. Now click on January 5th. The bug shows up in how the first week of January is not visible in the mini calendar. A related problem can be demonstrated by clicking on January 18th at this point. Notice how no red indicator appears on the 18th. Both these problems are addressed in the new version.

________________________________________________

Repair Your Copy

Buckle up...

Part 1. Pro Version Only

1. Backup your files.

2. Find and Duplicate the "Locate Selected Week" script in CCCalendar.fp5. Rename the newly duplicated script "Locate Selected Week on Week View".

3. Edit this script ("Locate Selected Week on Week View").

4. Change the ExitLoopIf step to use "ThirtyDay1WeekCalc" instead of "ThirtyDay1Calc" and to use "ThirtyDay7WeekCalc" instead of "ThirtyDay7Calc".

5. Edit the "Btn Show Current Week" script to call "Locate Selected Week on Week View" instead of "Locate Selected Week".

6. Edit all the "Select Day from Day 1 WeekMini" scripts in CCCalendar.fp5. There are 7 of these toward the end of the script list. Edit the first one ("Select Day from Day 1 WeekMini") from:
Code: Select all
Freeze  Window
Set Field [ LinkDateGlob, SelfbyCommonOne::ThirtyDay1WeekCalc - 7 ]
Perform Script [ ìLocate Selected Weekî ] [ Sub-scripts ]
Set Field [ LinkDateGlob, LinkDateGlob + 7 ]


To:
Code: Select all
Freeze  Window
Set Field [ LinkDateGlob, SelfbyCommonOne::ThirtyDay2WeekCalc ]
Perform Script [ ìLocate Selected Week on Week Viewî ] [ Sub-scripts ]


Edit the other 6 scripts to call ìLocate Selected Week on Week Viewî instead of ìLocate Selected Weekî in the Perform Script line.

Part Two. All Versions.

1. Backup your files.

2. Create new field: ThirtyDayRecordNumberCalc, type= calculation, returns number.

3. Define this calc as follows: Unstored calculation.
Code: Select all
Case( ThirtyDayFirstDayCalc=0, ThirtyDayRecordNumber-StartWeekOnMondayGlob, ThirtyDayRecordNumber )


4. Change the field definition for DayIndicatorRedCalc from
Code: Select all
GetRepetition(DayIndicatorRedHolderGlob,
If(
Day(LinkDateGlob)>=(1-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumber*7) and
Day(LinkDateGlob)<=(7-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumber*7),
DayofWeek(LinkDateGlob),
0) - StartWeekOnMondayGlob
)


To:
Code: Select all
GetRepetition(DayIndicatorRedHolderGlob,
If(Day(LinkDateGlob)>=(1-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumberCalc*7) + StartWeekOnMondayGlob and Day(LinkDateGlob)<=(7-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumberCalc*7) + StartWeekOnMondayGlob, DayofWeek(LinkDateGlob)-Case(DayofWeek(LinkDateGlob)=1 and StartWeekOnMondayGlob=1, -6,StartWeekOnMondayGlob) , 0) )


5. Change Each of the ThirtyDaySlot calcs (ThirtyDaySlot1Calc, ThirtyDaySlot2Calc, etc.) to use ThirtyDayRecordNumberCalc instead of ThirtyDayRecordNumber. The example below is from ThirtyDaySlot1Calc:

From:
Code: Select all
(1-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumber*7) +
If(PatternCount(Status(CurrentLayoutName), "week")>0,0,
StartWeekOnMondayGlob)

To:
Code: Select all
(1-ThirtyDayFirstDayCalc)+(ThirtyDayRecordNumberCalc*7) +
If(PatternCount(Status(CurrentLayoutName), "week")>0,0,
StartWeekOnMondayGlob)


That's it!
Last edited by John Sindelar on Fri Feb 03, 2006 5:00 am, edited 2 times in total.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Dec 16, 2003 9:35 am
And One More Thing...

Pro Version Only...

1. Backup Your Files. (really)

2. You need to create seven new background calcs for the mini calendar in the week view. Create the first one as follows:

Field Name: TDBackgroundDisplayWeekCalc1
Type: Calculation (Container) Evaluate even if all referenced fields are empty.
Definition:

Code: Select all
GetRepetition(ThirtyDayBkGroundGlob, Case( ThirtyDay1WeekCalc = LinkDateGlob and ThirtyDay1WeekCalc = Status(CurrentDate),5, ThirtyDay1WeekCalc = LinkDateGlob,4, ThirtyDay1WeekCalc = Status(CurrentDate),3, Month(ThirtyDay1WeekCalc) = Month(LinkDateGlob), 2, 1) )


3. Define the additional 6 versions of this naming them "...Calc2", "...Calc3", etc. In each definition, replace each instance of "ThirtyDay1WeekCalc " with the calc of the appropriate number ("ThirtyDay2WeekCalc ", "ThirtyDay3WeekCalc", etc." Here is the code for TDBackgroundDisplayWeekCalc2:

Code: Select all
GetRepetition(ThirtyDayBkGroundGlob, Case( ThirtyDay2WeekCalc = LinkDateGlob and ThirtyDay2WeekCalc = Status(CurrentDate),5, ThirtyDay2WeekCalc = LinkDateGlob,4, ThirtyDay2WeekCalc = Status(CurrentDate),3, Month(ThirtyDay2WeekCalc) = Month(LinkDateGlob), 2, 1) )


4. Now you'll need to use these fields in the mini calendar used on the week view; the mini calendar on the daily view is fine as is. You'll replace some fields already used in the calendar with the fields you created above. The fields you want to swap out are nested behind two other fields. The following instructions describe how to move the covering fields down and swap out the TDBackground calcs we're looking for.

5. User the picture below for reference and select the 7 top most fields (labeled "ThirtyDayWeek1Calcs, etc." below). Note that you can't drag select these or you'll get the fields under them as well. Move these down 10px. Add the next field ("DayIndicatorRedcalc") to your selection and move the whole mess down another 10px. (Now you know exactly how far up to move each component when you're done.)

Image

6. Now you can see the original TDBackground calcs we want to swap out. Replace each of these with the ones you just created above by double clicking on the original field and changing its specification. The relationship already in use is correct. You just need to specify the correct field.

7. Move the covering fields back up 10 or 20 px as needed.

8. Exhale.

9. That's it!

Return to CC Calendar (FM6)

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: