Page 1 of 1

Bug Fix: Week Numbers on Mini Calendars

PostPosted: Wed Sep 13, 2006 4:18 pm
by John Sindelar
The Issue

If you set the week to start on Mondays the week number beside the mini calendars on the daily view will be off in some cases.

This affects versions of SeedCodeCalendar prior to 3.13.

The Fix

This is fixed by editing one of the calendar's custom functions. If you don't have FileMaker Advanced, email me a copy of your file and I'll change this for you (you can email me here: john at seedcode.com)

To fix this replace the definition of the "SeedCode_MiniCalendarWeek" custom function with the following:

Code: Select all
Let ( [
f = GetField ( FieldName ) ;
n = ( ( Get ( CalculationRepetitionNumber ) -1 ) * 7 ) + 1  ;
minus = If ( StartWeekOnMonday = "Yes" ; -1 ; 0 ) ;
d = If ( not IsEmpty ( GetRepetition ( f ; n ) & GetRepetition ( f ; n + 6 ) ); Max (
GetRepetition ( f ; n ) + 3 ;
GetRepetition ( f ; n + 6 ) - 3
) ; // End Max
""  ) ; // End If
w = WeekOfYearFiscal ( d +  If ( StartWeekOnMonday = "Yes" ; 0 ; 1 ) ; 2 )
];

If ( not IsEmpty ( d ) ;
If ( StartWeekOnMonday <> "Yes" and d = GetRepetition ( f ; n ) and IsEmpty ( GetRepetition ( f ; n + 1 ) ) ;
Right ( "0" & w - 1 ; 2 ) ;
Right ( "0" & w ; 2 )
)
)

)


That's it.