----- Original Message ----- 
From: "Les Mizzell" <[EMAIL PROTECTED]>
To: "CF-Talk" <cf-talk@houseoffusion.com>
Sent: Wednesday, March 30, 2005 2:49 PM
Subject: Re: Alternating Row Colour - Here's What Finally Worked


> This is what I finally went with (watch the wrap):
>
> <!--- Default the previous day to the first returned item --->
> <cfparam name="prevDay" 
> default="#LSDateFormat(calendar["event_date"][1],
>                                  'mm/dd/yyyy')#" />


You could just start with a bogus date such as "1/1/1988" before you jump 
into your loop.


> <cfoutput query="calendar" group="theMONTH">
>   <h4>#LSDateFormat(calendar.event_date,'MMMM - YYYY')#</h4>
>   <div id="eventBODY">
>      <cfoutput>
>      <cfif LSDateFormat(calendar["event_date"][currentRow],'mm/dd/yyyy')
>            neq prevDay)>
>      <cfset prevDay = LSDateFormat(calendar["event_date"][currentRow],
>                       'mm/dd/yyyy') />


There shouldn't be any need to do all that date formatting.  If you have 
dates in your DB then you can compare them straight away.

Also, no need to use array addressing if you're just addressing the 
current row.

<cfif calendar.event_date neq prevDay)>
  <cfset prevDay = calendar.event_date>
  <cfset switch = 2 - switch + 1>
</cfif>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200853
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to