Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by johnjshi on Aug 06, 2008 11:49
open dhtmlx forum
dateformat

how can make the grid date cells using format of mm/dd/yyyy
instead of dd/mm/yyyy

<script>
var mygrid;
function doInitGrid(){
    mygrid = new dhtmlXGridObject('mygrid_container');
    mygrid.setImagePath("codebase/imgs/");         
    mygrid.setHeader("Select,Store,FOGID,In Store Date");
    mygrid.attachHeader("#rspan,#text_filter,#text_filter,#rspan");
    mygrid.setInitWidths("60,50,80,100");
    mygrid.setColAlign("center,center,center,right");
    mygrid.setSkin("light");     
    mygrid.setColTypes("ch,ro,ro,dhxCalendarA");
    mygrid.setColSorting("int,str,str,date");
    mygrid.setDateFormat("%m/%d/%y");
    mygrid.init();
    mygrid.loadXML("data/storeinstore.xml");
}
</script>
Answer posted by Support on Aug 07, 2008 01:27
The setDateFormat will set format for dhxCalendar and dhxCalendarA column types. 
In you case correct command will be
  mygrid.setDateFormat("%m/%d/%Y");

Beware that setDateFormat command supported only in pro version.