Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DisplayFormat being ignored when a date Formatter is set.

    Hello guys
    I'm using the last version of smart gwt.
    I have a form filtering a table through a Date that has to match the date in a column of the table.
    The table has a datasource and in that column the values are of type datetime (aka Timestamp on the database)
    I want the user to be able to search entries for a particular day (through a dateItem) but the time in the timestamp should be ignored.
    Otherwise the Date in the form has as default time 00:00 and if the entry in the table has time = 22:00 they won't match and the user won't find anything. So in the search, the time has to be ignored.
    In the form I declared a DateItem as follows:

    displayDateItem.setDisplayFormat(DateDisplayFormat.TOEUROPEANSHORTDATE);
    displayDateItem.setDateFormatter(DateDisplayFormat.TOSERIALIZEABLEDATE);
    displayDateItem.setInputFormat("YYYY-MM-DD");

    I need to pass the date as serializable date to match the one in the database (so I need inputFormat and DateFormatter). Now what happens, in the form I see a dateItem with a picker. When I pick a date, it gets displayed like this:

    2011-01-20 00:00:00

    But I don't want the user to see the time in the form. It makes no sense. So that's why I set the DisplayFormat. But the DisplayFormat instruction is totally ignored. Why?
    Can't I format my date someway and display it in another way?

    Thanks a lot for your feedback

    Laura
Working...
X