I have here a Bootstrap datepicker. I want to create a date picker wherein I can enter a date range if the Shift key is held, and multiple dates if the Ctrl key is held. Then the dates will be highlighted.
This is the code I have so far.
<input class="form-control" type="text" id="multi" name="multi">
$("#multi").on('keydown', function(event) {
if (event.shiftKey === true) {
isShift = true;
//alert(isShift);
console.log(isShift);
isCtrl = false;
return false
} else if (event.ctrlKey === true) {
//alert('ey ctrl press');
isCtrl = true;
console.log(isCtrl);
isShift = false;
return false
} else {
return false
}
});
$('#multi').datepicker({
multidate: true,
format: 'mm-dd-yyyy',
forceParse: false
}).on('hide', function(e) {
e.stopPropagation();
})