This is how I tried to set format for date:
var popCal = new dhtmlxCalendarObject('calendarObjId',true);
popCal.setDateFormat("%Y-%m-%d");
popCal.setPosition(300, 300);
popCal.attachEvent("onClick",function(date){
alert("Date is set to "+date);
}
But the date is not in the format of “2010-12-03” - it always looks like this “Fri Dec 3 01:01:00 CST 2010.” I know that format I was setting is the default, so I actually shouldn’t even need to set it.
Any suggestions? Thanks!
onClick get date object as a parameter. You may use getFormatedDate() method to apply formatting:
popCal.attachEvent(“onClick”,function(date){
alert("Date is set to "+this.getFormatedDate());
}
Thank you for the solution.
Now I have a different problem: I use “dhxCalendar” as column type, so when I double click on the column, a calendar window pops up - but the two arrows that I can click on to change month are missing. I do have the ar_left*.gif and ar_right*.gif files under my “${web_root}/scripts/imgs/” and dhtmlx javascript files under “${web_root}/scripts/”.
What calendar version do you use ? In the latest one (2.6) all buttons are defined by btns.gif
here is the demo:
dhtmlxGrid/samples/01_cell_types/01_calendar_grid.html