This is a migrated thread and some comments may be shown as answers.

Date visualisation

4 Answers 48 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Алексей
Top achievements
Rank 1
Алексей asked on 13 Jul 2014, 11:30 AM
At the server have something like that, to see if the date is correct
'System.err.println(rs.getDate("birth_date"));'
OK, it shows in console 1994-11-25

But in browser by JSON shows only "birthDate":"??? 25, 1994"
so it can't be shown at the jsp page

'<kendo:dataSource-schema-model-field name="birthDate" type="date">'
...
'<kendo:grid-column title="Birthdate" field="birthDate" />'

the column os empty.
What am I doing wrong?

Sincerely,
Alex

4 Answers, 1 is accepted

Sort by
0
Алексей
Top achievements
Rank 1
answered on 14 Jul 2014, 05:40 PM
So, the problem with month. Why it can't display just number of the month?
0
Atanas Korchev
Telerik team
answered on 16 Jul 2014, 06:20 AM
Hello,

Please try setting the format of the column:

<kendo:grid-column title="Birthdate" field="birthDate" format="{0:MM-dd-yyyy}" />

It controls the way dates are displayed.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Алексей
Top achievements
Rank 1
answered on 17 Jul 2014, 02:21 PM
Tried that, nothing. The column is epty.

As I understood the problem with json, because I have
[{""name":"Alex Alex Alex","birthDate":"??? 11, 1994"}]
when try to get information from servlet (not from jsp)

code from servlet
response.setContentType("application/json");
response.getWriter().print(_gson.toJson(patients));
 And have in browser the first row.

How can I fix it?

Sincerely,
Alex
0
Atanas Korchev
Telerik team
answered on 17 Jul 2014, 02:38 PM
Hi,

Unfortunately we are not sure what is causing GSON to serialize it like this. I recommend looking online for similar problems. Once you get the date to serialize correctly the Kendo UI grid will display it.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Алексей
Top achievements
Rank 1
Answers by
Алексей
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or