You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Toby Hobson <to...@btinternet.com> on 2008/05/13 00:36:56 UTC

Alternative to OutputLocale

Hi 

I was wondering if there is a way to display a localized date using an expansion, my idea is something like this: tml contains an expansion which references a Date object e.g. ${currentDate). Tapestry looks up the format for a date in the messageCatalogue and spits out the nicely formatted date. I'm assuming that at the moment tapestry converts an expansion to text by calling toString() on the object so is there any way to customize this and say "when you encounter a date, don't call toString() do xx"?

Thanks!

Toby


Re: Alternative to OutputLocale

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

How about ${format:date-format=object.date} where date-format is picked 
up from the message catalogue? That's only one of many exciting 
possibilities with the format binding prefix:

http://wiki.apache.org/tapestry/Tapestry5HowToAddMessageFormatBindingPrefix

I use it like that all the time. :)

-Filip

On 2008-05-13 00:36, Toby Hobson wrote:
> Hi 
> 
> I was wondering if there is a way to display a localized date using an expansion, my idea is something like this: tml contains an expansion which references a Date object e.g. ${currentDate). Tapestry looks up the format for a date in the messageCatalogue and spits out the nicely formatted date. I'm assuming that at the moment tapestry converts an expansion to text by calling toString() on the object so is there any way to customize this and say "when you encounter a date, don't call toString() do xx"?
> 
> Thanks!
> 
> Toby
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org