Cool idea...
So I guess I won't entirely get around writing a few lines of code...
Thanks for the ideas
MARK
Sam Gendler wrote:
Or you could store the format string as a localized message, pass it
to the SimpleDateFormat object, and format european dates for
europeans, us dates for americans, etc.
--sam
On 5/3/06, Eric Fesler <[EMAIL PROTECTED]> wrote:
An easy way would be to use a page property to return the formatted date
string.
Ex:
<span jwcid="@insert"
value="ognl:messages.format('currentServerDateAndTime',
page.currentDateTime">Current server date and time</span>
and on the page class/
public String getCurrentDateTime() {
SimpleDateFormat df = new SimpleDateFormat("MMMM d yyyy");
return df.format(new java.util.Date());
}
--ERic
On Wednesday 03 May 2006 09:40, Mark wrote:
> Hi,
>
> is there an easy way to pick the desired date format when using the
> message-bindings?
> In my example I have this in my html file:
> <span jwcid="@Insert"
> value="ognl:messages.format('currentServerDateAndTime', new
> java.util.Date())">Current server date and time: June 26 2005</span>
>
> The german resource entry looks like this:
> currentServerDateAndTime=Aktuelle Serverzeit: {0}
>
> The result is this:
> Aktuelle Serverzeit: 03.05.06 00:09
>
> This seems to be the short date format. What is the easiest way to
> change the date format to medium or long, so I can get the seconds,
etc?
>
> Thanks,
>
> MARK
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]