Right. Here's an example:
<span jwcid="@Insert" value="ognl:modificationTime"
format="ognl:dateFormat"/>
public DateFormat getDateFormat() { return dateFormat; }
private static final DateFormat dateFormat = new SimpleDateFormat
("yyyy-MMM-dd HH:mm");
I believe you can also inline the format in the page, though it's a
bit messier:
<span jwcid="@Insert" value="ognl:modificationTime" format="ognl:new
java.text.SimpleDateFormat('yyyy-MMM-dd HH:mm')"/>
(Warning: that second bit there is untested code.)
Cheers,
Paul
_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net
Post by Prince John, BedagHi Ryan,
Generally, in Java you can use (Simple)DateFormat to format dates.
In Tapestry, attach a DateTranslator to the field - you can define the
pattern as a parameter in your hivemodule.xml - or use the DatePicker,
passing a format parameter.
This sort of stuff is covered in Tapestry in Action, or in the user's
guide.
Best wishes
John
-----Original Message-----
Sent: Thursday, December 15, 2005 11:26 AM
Subject: Is there any way to display a Date as text in the format I
wondering?
Hi all,
I met a problem with displaying the a Date variable as text. I even
can
not choose the display format of Date.
For example: a Date variable "Date today = new Date()" which will be
displayed as "Thu Dec 15 00:00:00 CST 2005" on front-page,while
what I wanna is "2005-12-15".
So I am looking forward a way to solve this problem.
Thank,
Ryan.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-***@jakarta.apache.org
For additional commands, e-mail: tapestry-user-***@jakarta.apache.org