Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Highlighting the current day

$
0
0

So it looks like you're only outputting the current month, which makes things easier (if you add the ability to navigate backwards or forwards through the months and years, this code would need changed slightly).

 

Find out what today is:

 

<cfset thisDay = day(now())>

 

Then as you're looping over your 28-31 days, check if you're on the current day:

 

<cfloop index="x" from="1" to="#days#">

    <cfif x EQ thisDay>

        <td style="background-color:red">

    <cfelse>

        <td>

    </cfif>

   <cfoutput>#x#</cfoutput>

   </td>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>