Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Gayathri on Dec 13, 2007 07:10
open dhtmlx forum
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?

 

Answer posted by Support on Dec 13, 2007 09:31
>>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 )
Answer posted by Gayathri on Dec 14, 2007 01:24
Hi i use dhxCalendar excell. Please tell me how to do it. Thanks for your reply.
Answer posted by Support on Dec 14, 2007 04:48
>>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.