Сообщение от drkrol
|
Подскажи,
|
читайте документацию, там много интересного ...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.flatpickr-day.busy {
background-color: #FF0000 ;
}
</style>
</head>
<body>
<div id="slider"></div>
<link rel="stylesheet" href="https://unpkg.com/flatpickr/dist/flatpickr.min.css">
<script src="https://unpkg.com/flatpickr"></script>
<input class="flatpickr" type="text" placeholder="Select Date..">
<script>
var data = ["2016-12-12", "2016-12-16"];
flatpickr(".flatpickr", {
onDayCreate: function(dObj, dStr, fp, dayElem){
var a = fp.parseDate(data[0]), b = fp.parseDate(data[1]);
if (dayElem.dateObj.getTime() >= a && dayElem.dateObj.getTime() <= b)
dayElem.classList.add("busy")
}
});
</script>
</body>
</html>