Here you are.
<cfscript>
// replace now() with whatever date you are using.
year = year(now());
month = month(now());
FirstDateOfMonth = CreateDate(year,month,1);
LastDateOfMonth = CreateDate(year,month,DaysInMonth(FirstDateOfMonth));
FirstDayOfMonth = DayOfWeek(FirstDateOfMonth);
StartPadding = FirstDayOfMonth - 1;
FirstDateToShow = DateAdd('d',-StartPadding,FirstDateOfMonth);
LastDayOfMonth = DayOfWeek(LastDateOfMonth);
EndPadding = 7 - LastDayOfMonth;
LastDateToShow = DateAdd('d',EndPadding,LastDateOfMonth);
DaysInMonthToShow = DateDiff('d',FirstDateToShow,LastDateToShow) + 1;
NumberOfRows = DaysInMonthToShow / 7;
</cfscript>
There is a slightly faster way to do this. Hope this is helpful
Justin MacCarthy
Ireland
>-----Original Message-----
>From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 04, 2001 10:17 PM
>To: CF-Talk
>Subject: Calendar Question
>
>
>1) Does anyone have a fool proof formula from coming up with the number of
>rows in a calendar for a month.
>
>I've tried a couple of things but with no luck.
>
>TIA,
>Duane Boudreau
>CEO/CTO, CFExperts
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists