you are seriously a champion!

thanks mate i love your application of this

Rob.

On 11/02/2004, at 10:01 AM, Dave Watts wrote:

Hi Rob

I wrote an antarctic events database with this option
http://aadc-maps.aad.gov.au/aadc/events/on_this_day.cfm


The core bit is this <cfparam name="url.month" default="#DatePart('m', Now())#"> <cfparam name="url.day" default="#DatePart('d', Now())#"> <cfparam name="url.year" default="#DatePart('yyyy', Now())#">

<!--- Set the requested (or current) month/year date and determine the
number of days in the month. --->
<cfset ThisMonthYear = CreateDate(url.year, url.month, '1')>
<cfset Days = DaysInMonth(ThisMonthYear)>

<!--- Set the values for the previous and next months for the back/next
links. --->
<cfset LastMonthYear = DateAdd('m', -1, ThisMonthYear)>
<cfset LastMonth     = DatePart('m', LastMonthYear)>
<cfset LastYear      = DatePart('yyyy', LastMonthYear)>

<cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
<cfset NextMonth     = DatePart('m', NextMonthYear)>
<cfset NextYear      = DatePart('yyyy', NextMonthYear)>


<!--- display top label and navigation to next/previous month --->
<cfoutput>
<span class = "label">
<nobr><a href =
"on_this_day.cfm?day=1&month=#LastMonth#&year=#LastYear#"><b>&laquo;</ b>
</A>&nbsp;&nbsp;#MonthAsString(month)#&nbsp;#year#&nbsp;&nbsp;<A HREF =
"on_this_day.cfm?day=1&month=#NextMonth#&year=#NextYear#"><b>&raquo;</ b>
</A>
</span>
</cfoutput><p>


<!--- The actual calander table is displayed with this --->
        <table border = "1" cellpadding="4" cellspacing="0">
        <tr>
        <cfloop from = "1" to = "7" index = "loopday">
           <td width = "30" align = "center"><span class =
"label"><cfoutput>#Left(DayOfWeekAsString(LoopDay),
3)#</cfoutput></span></td>
        </cfloop>
        </tr>

<cfset ThisDay = 0>

<!--- Loop through until the number of days in the month is
reached. --->
<cfloop condition = "ThisDay LTE Days">
<tr>
<cfloop from = "1" to = "7" index = "loopday">
<cfif thisday is 0>
<cfif DayOfWeek(ThisMonthYear) IS
LoopDay>
<cfset ThisDay = 1>
</cfif>
</cfif>
<cfif (thisday is not 0) and (thisday lte days)>
<cfset bgcolor = '##ffffff'>
<cfif url.day is thisday> <cfset bgcolor =
"##f0f0f0"> </cfif>
<cfoutput><td bgcolor="#bgcolor#"><a
href="on_this_day.cfm? day=#thisday#&month=#url.month#&year=#url.year#">#
ThisDay#</a></cfoutput></td>
<cfset ThisDay = ThisDay + 1>
<cfelse>
<td>&nbsp;</td>
</cfif>
</cfloop>
</tr>
</cfloop>


</table>



Cheers dave




-----Original Message----- From: Gareth Edwards [mailto:[EMAIL PROTECTED] Sent: Wednesday, 11 February 2004 9:48 AM To: CFAussie Mailing List Subject: [cfaussie] RE: a basic calendar


Rob.


I have built a calendar at http://forum.tornadoes.org.au/

Althought this forum is not working fully yet, its just there so I can
test it.

To build a calendar you must work out how many days in the month, what
day the month starts, and how many days in the last week. Work it out
for the current month, then work out how to set and change the month.

Then it's as simple as using these values to draw the table cells, etc.

If your still un-sure I can send you the fairly messy one I have done. I
plan to redo the calendar at some stage, as because I was like yourself
when I did it I had little idea of how to build one, so I may have done
it in a some what messy fashion.


Gareth.

-----Original Message-----
From: rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 11 February 2004 7:38 AM
To: CFAussie Mailing List
Subject: [cfaussie] a basic calendar


Good morning people,


I am working on a system where it requires a calendar...

I have created the database to get the events in and out of the
calendar however i can't get my head round generating the calendar. has
anyone got a prebuilt calendar or a website that would allow me to get
some hints on how you did it??

thanks guys,

Rob.


---


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]


MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to