DHTMLX Calendar : Problem while using setSensitive()


I am using following snippet of code to set sensitive range in 2nd calendar i.e IncDate2 when I select date from 1st calendar IncDate.

//For Sensitive Range : S

             var dateFrom = new Date($(‘libseachfrm’).value);

         var dateTo = null;

alert("dateFrom : "+dateFrom );

         IncDate2.setSensitive(dateFrom, dateTo);

         //For Sensitive Range : E

But when I try to use setSensitive(), it gives me “Invalid Date” alert.

I have set the date format like : IncDate.setDateFormat(’%Y-%m-%d’);

Why this happens ??

Component expects to receive a javascript date object or javascript parsable string, not the formated date as parameter of setSensitive
If you want to use formated date, you can write it as