RE: Calendar Question

2001-01-06 Thread Duane Boudreau

Thanks everyone for the replies. I've been pulled in another direction
temporarily (job search ;)

Duane

> -Original Message-
> From: Jason Lees (National Express)
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 05, 2001 6:32 AM
> To: CF-Talk
> Subject: RE: Calendar Question
>
>
>
> Heres some psuedo code, I'm not sure how to do the actual CF but hope this
> helps
>
> CalRows=4
> if (daysInMonth=28 and firstdayinmonth>Sunday) or daysinmonth>28 then
>   calrows=5
> if (daysinmonth=30 and firstdayinmonth=Saturday) or (daysinmonth and
> firstdayinmonth>thursday) then
>   calrows=6
>
> This should work. This assumes the calender cols are in the order
> Sun-Sat.
>
>
>
> Jason Lees
> National Express
> Email : [EMAIL PROTECTED]
>
>
> -Original Message-
> From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
> Sent: 04 January 2001 22:17
> 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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Calendar Question

2001-01-05 Thread Jason Lees (National Express)


Heres some psuedo code, I'm not sure how to do the actual CF but hope this
helps

CalRows=4
if (daysInMonth=28 and firstdayinmonth>Sunday) or daysinmonth>28 then
calrows=5
if (daysinmonth=30 and firstdayinmonth=Saturday) or (daysinmonth and
firstdayinmonth>thursday) then
calrows=6

This should work. This assumes the calender cols are in the order Sun-Sat. 



Jason Lees 
National Express
Email : [EMAIL PROTECTED]


-Original Message-
From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2001 22:17
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Calendar Question

2001-01-05 Thread JustinMacCarthy

Here you are.




// 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; 



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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Calendar Question

2001-01-04 Thread Nick Slay

Oops, 

Sorry Duane, I misled you... after looking back through the code, I don't
actually have a formula, I simply have a table that will display 4, 5 or 6
rows which is dynamically calculated using loops.  So if you are after
something that can only show 4 rows, or show 6, depending on the days in the
month etc, let me know and I'll send the loops over to you.

Regards

Nick


> From: "Duane Boudreau" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Thu, 04 Jan 2001 17:17:06 -0500
> To: CF-Talk <[EMAIL PROTECTED]>
> 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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists