smalot / bootstrap-datetimepicker

Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)
http://www.malot.fr/bootstrap-datetimepicker/
Apache License 2.0
3.49k stars 1.65k forks source link

Able to navigate through keyboard on disable dates #723

Open vaidehihirani opened 6 years ago

vaidehihirani commented 6 years ago

Please consider a scenario that we have set startDate and endDate using setStartDate and setEndDate function. After that we have disabled some dates using setDatesDisabled function. Now, user can not navigate through keyboard on the dates which are out of range but can able to navigate and select disabled date which should be prevented.

$("#calendarInput").datetimepicker({format: "m/d/yyyy"}); $("#calendarInput").datetimepicker("setStartDate", "5/10/2018"); $("#calendarInput").datetimepicker("setEndDate", "5/25/2018"); $("#calendarInput").datetimepicker("setDatesDisabled", ["5/11/2018", "5/13/2018"]);

For above code, user should not be able to select 5/11/2018 through keyboard navigation as it is disabled.