You need to sign in to do that
Don't have an account?
paul-lmi
Is there a better way to format this date in VF?
I'm grabbing a datetime from a field binding in VF and I need to format it like YYYY-DD-MM . The problem is, Salesforce will format as a single digit day and month instead of retaining the leading 0.
Is this the most efficient way to overcome that?
{!(TEXT(YEAR(d.lastpublisheddate)) & "-" & IF(LEN(TEXT(MONTH(d.lastpublisheddate)))==2,TEXT(MONTH(d.lastpublisheddate)),"0" & TEXT(MONTH(d.lastpublisheddate))) & "-" & IF(LEN(TEXT(DAY(d.lastpublisheddate)))==2,TEXT(DAY(d.lastpublisheddate)),"0" & TEXT(DAY(d.lastpublisheddate))))}
For various reasons, I don't want to do this in Apex directly, mostly due to shared code that'd get exponentially more complicated if I was to do this transformation in Apex.
<apex:outputText> doesn't generate a <span> unless you specify CSS along with the tag. Best, Steve.
All Answers
Presuming you're trying to display this on a VF page... (otherwise, what are you trying to do with it? :-) ) Best, Steve.
It's for outputing XML, so I can't use anything that adds span tags, unfortunately.
<apex:outputText> doesn't generate a <span> unless you specify CSS along with the tag. Best, Steve.
ah, i wasn't aware of that. thanks for the insight Steve.