Question
Datediff question
I have the following code:
<cfset DateList=dateformat("7/24/2006","mmmm d,yyyy")>
<cfset CurrDate=dateformat(now(),"mmmm d,yyyy")>
<cfloop list="#DateList#" index="cDate" delimiters=",">
<cfif datediff("ww",#CurrDate#,#cDate#) gt 1>
<span style="color:#FF0000;"><cfoutput>#cDate#</cfoutput><br /></span>
<else>
<span style="color:#00CC00;"><cfoutput>#cDate#</cfoutput><br /></span>
</cfif>
</cfloop>
I'm trying to get the date to display in 1 color if the time between now and
the date listed is more than a week. My problem is that its return the date
in color, but both colors.
Also, if I wanted to have a loop within a loop, so a loop that counts from 1
to 7, and then within that loop, another list loop that lists 1 date per
item, how can I do that? I'm a little rusty on my loop stuff!
Thanks!
Steve
<cfset DateList=dateformat("7/24/2006","mmmm d,yyyy")>
<cfset CurrDate=dateformat(now(),"mmmm d,yyyy")>
<cfloop list="#DateList#" index="cDate" delimiters=",">
<cfif datediff("ww",#CurrDate#,#cDate#) gt 1>
<span style="color:#FF0000;"><cfoutput>#cDate#</cfoutput><br /></span>
<else>
<span style="color:#00CC00;"><cfoutput>#cDate#</cfoutput><br /></span>
</cfif>
</cfloop>
I'm trying to get the date to display in 1 color if the time between now and
the date listed is more than a week. My problem is that its return the date
in color, but both colors.
Also, if I wanted to have a loop within a loop, so a loop that counts from 1
to 7, and then within that loop, another list loop that lists 1 date per
item, how can I do that? I'm a little rusty on my loop stuff!
Thanks!
Steve