Don't know what you found in the UDF, probably better then what I got, but
this is something I created a couple of years ago, that automatically
calculates the 2nd Tuesday of the Month for our CFUG meetings.  I'll have to
look into the UDF at cflib.

<cfset Month = Month(Now())>
<cfswitch expression="#DayOfWeek(CreateDate(Year(Now ()), Month, 1))#">
        <cfcase value="3"><cfset dayoffset = "1"></cfcase>
        <cfcase value="2"><cfset dayoffset = "2"></cfcase>
        <cfcase value="1"><cfset dayoffset = "3"></cfcase>
        <cfcase value="7"><cfset dayoffset = "4"></cfcase>
        <cfcase value="6"><cfset dayoffset = "5"></cfcase>
        <cfcase value="5"><cfset dayoffset = "6"></cfcase>
        <cfcase value="4"><cfset dayoffset = "7"></cfcase>
</cfswitch>

<cfif CreateDateTime(Year(Now ()), Month, 7 + dayoffset, 18, 30, 59) LTE
Now()>
        <cfset Month = Month + 1>
        <cfif Month EQ 13>
                <cfset Month = 1>
        </cfif>
        <cfswitch expression="#DayOfWeek(CreateDate(Year(Now ()), Month,
1))#">
                <cfcase value="3"><cfset dayoffset = "1"></cfcase>
                <cfcase value="2"><cfset dayoffset = "2"></cfcase>
                <cfcase value="1"><cfset dayoffset = "3"></cfcase>
                <cfcase value="7"><cfset dayoffset = "4"></cfcase>
                <cfcase value="6"><cfset dayoffset = "5"></cfcase>
                <cfcase value="5"><cfset dayoffset = "6"></cfcase>
                <cfcase value="4"><cfset dayoffset = "7"></cfcase>
        </cfswitch>
</cfif>

<cfset Next Meeting = CreateDateTime(Year(Now ()), Month, 7 + dayoffset, 18,
30, 59)>

Ian


-----Original Message-----
From: Owens, Howard [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:22 PM
To: CF-Talk
Subject: anybody ever done: every n day of the month for a year ... 


Just to save me spending too much time trying to figure this out ...

Anybody already have a code snippet for calculating every N day of the
Month, for a year ... 

Such as, Every 3rd Tuesday of the month?

That's where I'm at on building my little recurrance engine.  I'll spit the
whole code back out the list when it's done, if anybody wants it.

H.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Owens
Internet Operations Coordinator
InsideVC.com/Ventura County Star
[EMAIL PROTECTED]
AIM: GoCatGo1956
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to