<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> |