Please help me.
How to highlighted multiple dates?
I want multiple dates highlighted in datepicker control. That are fetched from database.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Swati DeshmukhPosted Nov 27, 2013, 12:02 AM
Jaganathan BantheswaranPosted Nov 26, 2013, 1:09 AM
The question is on WPF
Abhay ShankerPosted Nov 26, 2013, 1:07 AM
$(function() {
var datesArray=['11/1/2013','11/4/2013']
var datesArray1=['11/5/2013','11/8/2013']
$( "#datepicker" ).datepicker({
numberOfMonths: 3,
showButtonPanel: true,
selectMultiple:true,
beforeShowDay: function (date) {
var theday = (date.getMonth()+1) +'/'+
date.getDate()+ '/' +
date.getFullYear();
return [true,$.inArray(theday, datesArray) >=0?"specialDate":($.inArray(theday, datesArray1)>=0?"specialDate1":'')];
}
});
//$.inArray(theday, datesArray) >=0?"specialDate":'specialDate1'
});
CSS
specialDate { background-color: #6F0 !important; }
.specialDate1 { background: #e81e46; }
Jaganathan BantheswaranPosted Nov 26, 2013, 12:40 AM
You can do this using the property BlackoutDates of datepicker control.
http://msdn.microsoft.com/en-us/magazine/dd882520.aspx
http://www.codeproject.com/Articles/88757/WPF-Calendar-and-Datepicker-Final