Date PostFix
Puts 'st', 'nd', 'rd' or 'th' after a monthday number
<cfscript>
// Code to decide what postFix goes onto a day e.g. 21st. Requires the day of the month sent to it in numeric format.
function dayPostFix(thisDay)
{
	if (isNumeric(thisDay))
	{
		if (thisDay EQ 01 OR thisDay EQ 21 OR thisDay EQ 31) 
		{
			return(thisDay & "st");
		}
		else if (thisDay EQ 02 OR thisDay EQ 22) 
		{
			return(thisDay & "nd");
		}
		else if (thisDay EQ 03 OR thisDay EQ 23) 
		{
			return(thisDay & "rd");
		}
		else
		{
			return(thisDay & "th");
		}
	}
	else
	{
		return(thisDay);	
	}
}
</cfscript>
 

cover
Buy Fusebox 5 & FLiP: Master-Class ColdFusion Applications
cover
Buy Fusebox 4 & FLiP: Master-Class ColdFusion Applications
cover
Buy ColdFusion Lists, Arrays, & Structures
cover
Buy ColdFusion XML Objects

Dedicated and Shared CF Hosting 2021