Format for dhxCalendar not working

I set the date column format from xml (in server Java code). My goal is to get rid of the “time” part. I use a format of ‘%Y-%m-%d’, but the time part always shows up like this: “2010-12-17 00:00:00.0” (what I want is “2010-12-17”).

Here is my code:

<column width='150' align='left' format='%Y-%m-%d' type='dhxCalendar' >Date</column>

If I change the format to ‘%m-%d-%Y’, the browser doesn’t even display the data and the column becomes blank.

But the popup calendar always behaves perfectly - when I double click on the empty column, it comes up; when I click a day, it fills the grid with correct format.

“format” attribute define format for the displayed date in the a grid. However, grid expects incoming date in JS format: m/d/Y

setDateFormat allows to define two formats: for displayed and incoming date. Therefore, you need to use the following instead of format attribute:

<rows> <head> <beforeInit> <call command="setDateFormat"> <param>%m-%d-%Y</param><param>%m-%d-%Y</param> </call> </beforeInit> <column width='150' align='left' type='dhxCalendar' >Date</column> ....