Re: Formatting a date

Sven Schliesing <[email protected]> Mon, 27 Mar 2006 03:47:08 +0200
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
That's exactly what I looked for.

Big Thanks!

Sven

Keats Kirsch wrote:
> If you define the method as a function you can make it a bit shorter.  
> One way is to add this to your WebMacro.properties file:
> 
> Functions.formatDate=org.webmacro.servlet.TextTool.formatDate
> 
> Then you can drop the Text part, and use:
> 
> $formatDate($createdAt, "dd.MM.yyyy, HH:mm")
> 
> Other options would be to drop a date formatter into your context and 
> use that, or develop your own DateTool or something like that.  You 
> could even create a custom date object with predefined formats.  E.g.,
> 
> #bean $wmDate=WMDate initArgs=$createdAt
> $wmDate.DATETIME1
> 
> Hope this helps.
> 
> Keats


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642