0

I have implemented DHTMLX schedules to show events on my website. Scheduler on dashboard also have DHTMLX calendar which used to select week for dhtmlx scheduler.

here is an sample: http://docs.dhtmlx.com/scheduler/samples/05_calendar/05_plain_structure.html

Here is my code that I've written to generate DHTMLX calendar.

var calendar = scheduler.renderCalendar({
                    container:"cal_here",
                    date:scheduler._date,
                    navigation:true,
                    handler:function(nwdate,calendar){
                    var date = new Date(nwdate);
                    getdate=date.getFullYear()+ '-' + (date.getMonth() + 1)+ '-' +date.getDate();
                    scheduler.setCurrentView(date, scheduler._mode);
                    }
                });

I went through documentation but couldn't find anything helpful.

Mahendra
  • 908
  • 1
  • 18
  • 38

2 Answers2

0

Updated :

You can use the setSensitiveRange

http://docs.dhtmlx.com/doku.php?id=dhtmlxcalendar:api_method_dhtmlxcalendar_setsensitive

Pass null as a second parameter

Tarek
  • 3,810
  • 3
  • 36
  • 62
  • Thanks Tarek.. But this doesn't seem to be working. I need date limitation on calendar not on scheduler. – Mahendra Feb 05 '14 at 11:16
  • So you just want to completely hide the calendar ? – Tarek Feb 05 '14 at 11:25
  • No I just want to disable past dates on Mini Calendar. – Mahendra Feb 05 '14 at 11:32
  • I tried that too. it says "calendar.setSensitiveRange is not a function"; – Mahendra Feb 05 '14 at 11:41
  • I'm not sure if you are using the calendar or the scheduler because calendar are instantiated using : var myCalendar = new dhtmlXCalendarObject – Tarek Feb 05 '14 at 11:45
  • Yes exactly. I tried it in that way too but the mini calendar that I'm using is co ordinate with scheduler. So this doesn't work with it. see the sample link I've given on question. – Mahendra Feb 05 '14 at 12:07
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/46844/discussion-between-mahendra-and-tarek) – Mahendra Feb 05 '14 at 12:08
0

You can initialize Date for your html Calendar Add this code in the form_load!

> scheduler.InitialDate = new DateTime(2015, 01, 01);

You might want to know more, visit the following site;

http://blog.scheduler-net.com/post/simple-event-calendar-asp-net.aspx

Nai
  • 430
  • 5
  • 15