I've been using the following bit of code in my Visualforce pages to get the so called ordinal indicators (the 'st', 'nd', 'rd', and 'th' in 1st, 2nd, 3rd, 4th) when formatting dates.
<apex:outputText value="{!CASE(MOD(DAY(TODAY()),10),1,"st",2,"nd",3,"rd","th")}"/>
It's clunky however and isn't friendly when using <apex:param>
tags. I was wondering if anyone had any tricks to accomplish this nicely. I'd prefer not to create a method in the controller to do this as I it would involved writing more unit tests.
Case
function, what problem are you facing with apex:param?<apex:outputText value="{0,date,MMM'. 'ddd}{1}', '{0,date,yyyy}"><apex:param value="{!account.LastModifiedDate}"/><apex:param value="{!CASE(MOD(DAY(account.LastModifiedDate.date()),10),1,"st",2,"nd",3,"rd","th")}"></apex:outputText>
it just starts to get messy