Sorry, I have not explained more in detail.
I know how to format a date, but I'm using the DefaultDataTable component so inside the component is filling the data taking the info from my model object.
I have this code:

List<IColumn<?>> columns = new ArrayList<IColumn<?>>();
columns.add(new PropertyColumn(new Model<String>("Delivery Date"), "deliveryDate", "deliveryDate"));
...
DefaultDataTable table = new DefaultDataTable("table", columns, new SortableDocumentDataProvider(docs), 8);
...

also I have this class:

public class SortableDocumentDataProvider extends SortableDataProvider<Document>{
...

and Document has a Date property, called "deliveryDate"

When the html is rendered, the date appears as "00:00" instead of "2000/01/02". The only way I found, to solve this, is adding a String property that represents the date in the format I want, but I suppose that should exist a better solution.

Thanks
Pablo
--------------------------------------------------
From: "Edgar Merino" <[EMAIL PROTECTED]>
Sent: Wednesday, October 01, 2008 7:28 PM
To: <[email protected]>
Subject: Re: DefaultDataTable with date column

Use java.text.DateFormat for that matter (take a look at SimpleDateFormat in case you need more control over how you want your date to be formatted).

Edgar Merino


Pablo S. escribió:
Hi, I would like to know how I can format a value from 1 column that is a date. I've a sortable dataprovider that contains my object, and one of the fields is a date. The html table shows the digits of the hour of the date (example: "00:00") instead of something like this "2000/02/03"

Thanks
Pablo



---------------------------------------------------------------------
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]

Reply via email to