Olayların bulunduğu hücreler için arka plan rengini değiştirmek istiyorum. Bu gün için bu durumda jQuery DatePicker olayın bulunduğu hücreler için arka plan rengi (açık)
: 2016-04-07ben SO burada bir çözüm bulamazsanız, birisi bana yardımcı olabilir umuyoruz. size
JS kodu ederiz:
// I WANT TO CHANGE BACKGROUND-COLOR FOR THIS DAY
var events = {"2016-04-07":[{"title":"Friday!!!!","description":"Weekend is starting!!!"}]};
// Setup our datepicker
$("#datepicker").datepicker({
dateFormat: "yy-mm-dd",
onSelect: findEvents
});
// Provide a function to find and display events
function findEvents (date) {
// Start by emptying our data container
$("#dateevents").empty();
// Potential date object
var dateObj = events[date];
// If no events exist for the selected date
if (!dateObj) {
return $("#dateevents").html("<h2>" + date + ": No Events</h2>");
}
// If we've made it this far, we have events!
$("#dateevents").html("<h2>" + date + ": " + dateObj.length + " Events Planned</h2>");
// Cycle over every event for this date
$.each(dateObj, function (index, event) {
// Build a list for each event
var $list = $("<ul>");
// Add all event details to list
$.each(event, function (name, desc) {
$("<li>").html(name + ": " + desc).appendTo($list);
});
// Place list in container
$list.appendTo("#dateevents");
});
}
Fiddle: http://jsfiddle.net/qSCek/6/
Olası kopyalar [bir jquery datepicker hücre rengini değiştirmek için nasıl] (http://stackoverflow.com/questions/2906266/how-to-change-the-cell- renk-of-a-jquery-datepicker) – TyrantsBeard
@TyrantsBeard on'Yazdır ancak tarih seçicisi yüklendiğinde –