You need to sign in to do that
Don't have an account?
Formatting <apex:outputText> in specified locale??
Hi all,
visualforce supports formatting an outputtext (date, currency, etc) using java messaging based formatter option, eg:
<apex:outputText value=", {0,date,M/d/yyyy h:mm a}">
<apex:param value="{!Account.CreatedDate}"></apex:param>
</apex:outputText>
However this only works for the US locale. This is a major flaw for companies trying to develop visualforce outside of US.
I know outputField will display in the user locale, however this will not allow custom formatting. IMO we are left with a incomplete solution here.
Eg. if i try to display just the time part of a local time (in GMT+1 timezone) on a visualforce page, i have to use Apex to achieve this.
The same is the case when i want to use a different decimal separator on numbers.
An idea to fix this is already posted here: https://sites.secure.force.com/success/ideaView?id=08730000000g62yAAA
I would be very interested if anyone created a generic workaround for this.
Thanks!
it should display the field with the same formatting that you would see in standard Salesforce.
Thanks for your reply, but that won't allow the formatting i would like to see.
I ended up writing a custom component to achieve this.