I want to Add button to dhtmlxCalendar

I want to make button to dhtmlxcalendar

for example

“select today” button

or

“Clear date” button

How can i modify dhtmlxCalendar??

Could you provide a graphic example?

Image Sample

hi

[code]
// call this code after calendar init

myCalendar.showTime(true);

var t = myCalendar.contTime.firstChild.firstChild;
for (var q=0; q<t.childNodes.length; q++) t.childNodes[q].style.display = “none”;

t.innerHTML += “

”+
today”+
" "+
clear”+
”;
t = null;

// add this function once into global visible scope

function doClick(mode) {
if (mode == “today”) {
myCalendar.setDate(new Date().getTime());
}
if (mode == “clear”) {
myCalendar.setDate(null);
}
}[/code]

Will I tried.

So. When I Click Today Button, Focus moves only.

I want more.

When click Today button,

‘Calendar Is Closed’ and ‘Return Today’ like Click Day.

How can i do?

well

try this
tested on demo dhtmlxCalendar/samples/05_events/02_onclick_onbeforechange.html

function doClick(mode) { if (mode == "today") { var d = new Date(); if (myCalendar.callEvent("onBeforeChange",[d]) === true) { myCalendar.setDate(d); if (myCalendar._activeInp != null && myCalendar.i[myCalendar._activeInp] != null && myCalendar.i[myCalendar._activeInp].input != null) { myCalendar.i[myCalendar._activeInp].input.value = myCalendar._dateToStr(new Date(myCalendar._activeDate.getTime())); } myCalendar.hide(); myCalendar.callEvent("onClick",[d]); } } if (mode == "clear") { myCalendar.setDate(null); if (myCalendar._activeInp != null && myCalendar.i[myCalendar._activeInp] != null && myCalendar.i[myCalendar._activeInp].input != null) { myCalendar.i[myCalendar._activeInp].input.value = ""; } } }

This way must modify all files used calendar.

So. very difficult

and, This way can’t use calendar attached to grid.

The another way(modify dhtmlx.js) you can not?