0

Listgrid in my smartgwt project have some dateitem field which allow user to select date from calender for particular row. When user select it show project in related textfield(in cell) mm/dd/yyyy.

When I try to fetch the value of that cell it return me a very long date value.

example If I select 09/09/2014 and when I try to fetch the value it return me as Tue Sep 09 2014 12:00:00 GMT+0530 (India Standard Time).

Manish Jain
  • 842
  • 1
  • 11
  • 29

1 Answers1

0

According to the documentation, the server must send dates with the following format:

dateField: "2007-04-22"

timeField: "11:07:13"

dateTimeField: "2007-04-22T11:07:13"

dateTimeField: "2007-04-22T11:07:13.582"

You can achieve that with this snippet:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.format(myDate);

Then, in the client side, you can format the date with SmartGWT:

myListGridField.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
Community
  • 1
  • 1