Calendar Today button not working with setSensitiveRange

You can replicate the issue by adding setSensitiveRange to this sample.

[url]http://dhtmlx.com/docs/products/dhtmlxCalendar/samples/04_other/05_show_time.html[/url]

Show / hide today and time

Hi

today date is disabled by script, what do you think awaited behaviour should be in this case?

In my understanding, new Date() should return Today’s date, that means all dates until today (inclusive) will be sensitive.
However, there are nothing happened after the “Today” button is clicked.

docs.dhtmlx.com/api__dhtmlxcalen … range.html
// all dates until the 1st of June, 2011 (inclusive) will be sensitive
myCalendar.setSensitiveRange(null, “2011-06-01”);

Nothing happend because you disabled today manually by calling setSensitiveRange. Purpose of this functionality is do not allow user select some certain dates by click also by today button.

setSensitiveRange is to disallow user selecting today’s date by clicking today button even today’s date is in the sensitive range.
Do you think it is logical? :unamused:

The dhtmlxCalendar is very good!
I have the same problem.

If today is 2016-06-10 and I set:

myCalendar.setSensitiveRange("2016-06-01", "2016-06-11");

the date 2016-06-10 is cliclable, and the TODAY button work well.

If today is 2016-06-10 and I set:

myCalendar.setSensitiveRange("2016-06-01", "2016-06-10");

the date 2016-06-10 is cliclable, but the TODAY button not work.

If today is 2016-06-13 and I set:

myCalendar.setSensitiveRange("2016-06-01", "2016-06-13");






This is a bug

Hi

Tried locally - seems it works fine, but I not sure I reproduced it 100%

Could you please provide us complete demo?
Please also add information regarding current and expected behaviour.

Here is a small guide how to make a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

If you don’t want to share your demo here for any reasons - you can send it to support@dhtmlx.com, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to support@dhtmlx.com

Hi

DEMO.zip (669 KB)

How to reproduce the problem:
STEP.zip (145 KB)

Danylo

Hi

Thanks for demo. Please try the following:

// dhtmlxcalendar.js line 470 if (t.className && t.className == "dhtmlxcalendar_label_today") { var d = new Date(); d = new Date(d.getFullYear(), d.getMonth(), d.getDate(), that._activeDate.getHours(), that._activeDate.getMinutes(), that._activeDate.getSeconds(), that._activeDate.getMilliseconds()); that.setDate(d); that._updateInp(); that.callEvent("onButtonClick", [d]); }

Perfect! Now work fine for me.
Thank you

Danilo