Re: Formatting a date
Keats Kirsch <[email protected]> Sun, 26 Mar 2006 18:09:41 -0500
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Sven Schliesing wrote: > is there a shorter way for this? > $Text.formatDate($createdAt, "dd.MM.yyyy, HH:mm") 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 > > Thanks in advance > > Sven > ------------------------------------------------------- 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