DHX Calendar : How to reset the calendar

Hi there,

I want to reset the month which is shown in the calendar.



Take this situation :



1. When I click on calendar, it shows the current month. When I iterate thru some of the previous months and close the

calendar then I close the calendar.

2. When I again open the calendar, it should show the current month instead of previously shown month.



How to achieve this ?

You can try to use the following approach:

1) to get the currect date:

var cur_date;

mCal = new dhtmlxCalendarObject(…);

mCal.draw();
cur_date = mCal.cutTime(new Date());

2) and set this date each time when the calendar is shown:

function show() {

mCal.show();
mCal.setDate(cur_date);

}

Hi there,
            Its not working.

            Take this situation:
            1. Click on calendar, choose a date.
            2. Again click on calendar, go to some 3-4 months back, DON’T choose a date and close the calendar(I have given a close button on calendar)
            3. It shows 3-4 months back calendar, not the month of which I chose the date.

            Why ?

When I again open the calendar, it should show the current month instead of previously shown month.

mCal.setDate(new Date()); //this command will alway set the current date
mCal.show();