Calendar default date to sysdate and disable past dates


Hi



Is it possible that when calendar cell is clicked and calendar is shown, to show the current date instead some other date(Now it shows, january 1970) also i want to disable past dates. Is it possible to achieve in grid?



 

to show the current date instead some other date
Can be done by source code modification, do you use “calendar” or “dhxCalendar” excell ?

>> i want to disable past dates
Possible. with few additional lines of code in case of dhxCalendar ( it is based on dhtmlxCalendar, which has possibility to set min. and max. possible dates )

Hi i use dhxCalendar excell. Please tell me how to do it. Thanks for your reply.

to show the current date instead some other date

In dhtmlxgrid_excell_dhxCalendar.js you can update next line

    _grid_calendarA.setDate(this.val);
with
    _grid_calendarA.setDate(this.val || _date_object_with_any_desired_date_here );
or
    _grid_calendarA.setDate(this.val || (new Date())); //today




>> i want to disable past dates
In dhtmlxgrid_excell_dhxCalendar.js you can locate line

    _grid_calendarA.setYearsRange(1900, 2100);
and add next to it
    _grid_calendarA.setSensitive(fromDate,toDate);

where fromDate and toDate - min and mas date allowed for selection.