I am using bootstrap datepicker.I need to highlight some random dates.
For Example:
I need to highlight the dates like 1,3,8,20,21,16,26,30. Could you please tel
The Blog post here explaining how it can achieve using Bootstrap Datetimepicker.
Basically using the events show, update and change the date need to be highlighted.
$('#datetimepicker').on('dp.show', function(e){
highlight()
})
$('#datetimepicker').on('dp.update', function(e){
highlight()
})
$('#datetimepicker').on('dp.change', function(e){
highlight()
})
function highlight(){
var dateToHilight = ["04/19/2019","04/20/2019","04/30/2019"];
var array = $("#datetimepicker").find(".day").toArray();
for(var i=0;i -1) {
array[i].style.color="#090";
array[i].style.fontWeight = "bold";
}
}
}
For more information see the blog
Reference:
https://scode7.blogspot.com/2019/04/here-is-code-function-hilight-var.html