This may work, I am assuming that you are using this as a custom tag...

Replace:
<CFSET Attributes.dateCurrent = DateAdd("m", 3, Now())>

With:
<CFPARAM NAME="attributes.dateCurrent" default="#Now()#">

Then if you want to use a different date, say:
<CF_MyCalendarTag dateCurrent="12/12/00">

______________________________________________
Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM / NETDesign Inc.
ColdFusion Developer Resources
http://www.cfdev.com/

-----Original Message-----
From: Jon Tillman [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 10:15 PM
To: CF-Talk
Subject: dynamically filling out a calendar redux


At the beginning of this month, I asked about dynamically filling in a
calendar
with the days of the current month....or any month for that matter, and
Jeremy
Allen was kind enough to provide some code.

I have now gotten around to looking at it, and as it was presented, it fills
everything out the same way. I am a bit dense about date functions in Cf, so
if
you could be so kind Jeremy, as to point out what has to be modified in
order
to set it up right, as I would like it to display the current month, unless
another is passed to it.

I include the original snippet below:

---------------snippet-------------------------
       <CFSET Attributes.dateCurrent = DateAdd("m", 3, Now())>
         <TABLE WIDTH="50%" ALIGN="center">
                 <CFSET dateFirstDay =
CreateDateTime(Year(Attributes.dateCurrent),
         Month(Attributes.dateCurrent), 1, 0, 0, 0)>
                 <CFSET dateLastDay =
CreateDateTime(Year(Attributes.dateCurrent),
         Month(Attributes.dateCurrent), DaysInMonth(Attributes.dateCurrent),
0, 0,
         0)>
                 <CFSET offset = DayofWeek(dateFirstDay)>
                 <CFSET dateTmp = dateFirstDay>
                 <CFLOOP FROM="1" TO="#DaysInMonth(Attributes.dateCurrent)#"
INDEX="i">
                         <CFIF DayOfWeek(dateTmp) EQ 1 OR i EQ 1>
                         <TR>
                         </CFIF>
                         <CFIF i EQ 1>
                                 <CFLOOP FROM="1" TO="#(offset - 1)#"
INDEX="j">
                                         <TD BGCOLOR="#EEEEEE" WIDTH="14%">
                                                 <FONT
SIZE="2">&nbsp;</FONT>
                                         </TD>
                                 </CFLOOP>
                         </CFIF>
                         <TD BGCOLOR="#AAAAAA" WIDTH="14%" HEIGHT="45"
VALIGN="TOP">
                                 <CFOUTPUT><FONT
SIZE="1">#i#</FONT></CFOUTPUT>
                         </TD>
                         <CFIF i EQ DaysInMonth(Attributes.dateCurrent)>
                                 <CFSET fillIn = DayOfWeek(7 - dateTmp)>
                                 <CFLOOP FROM="1" TO="#fillIn#" INDEX="k">
                                         <TD BGCOLOR="#EEEEEE" WIDTH="14%">
                                                 <FONT
SIZE="2">&nbsp;</FONT>
                                         </TD>
                                 </CFLOOP>
                         </CFIF>
                         <CFIF DayOfWeek(dateTmp) EQ 7>
                         </TR>
                         </CFIF>
                         <CFSET dateTmp = DateAdd("d", 1, dateTmp)>
                 </CFLOOP>
         </TABLE>
--------------end snippet-----------------------

 --
***********************************************
 Jon Tillman
 LINUX USER: #141163
 ICQ: 4015362
 http://www.eruditum.org
 [EMAIL PROTECTED]
 JAPH
***********************************************
Be alert, the world needs more lerts
***********************************************

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to