Only weekends and specific dates are available
Hi,
Is it possible to enable specific dates at the sametime weekends in datepicker?
I have disabled all the dates and enable some certain dates, but i want also to enable weekends.
please see my codes.
Thanks
- var availableDates = ["9-4-2013","1-5-2013","12-6-2013","21-8-2013","26-8-2013","1-11-2013","24-12-2013","25-12-2013","30-12-2013","31-12-2013",
"1-1-2013"];
function available(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear();
if ($.inArray(dmy, availableDates) != -1) {
return [true, "","Available"];
} else {
return [false,"","unAvailable"];
}
}
$(function() {
$('#textFromDate').datetimepicker({
dateFormat: "yy-mm-dd",
minDate: 0,
beforeShowDay: available
});
});
</script>
<script>
$(function() {
$('#textToDate').datetimepicker({
dateFormat: "yy-mm-dd",
minDate: 0,
beforeShowDay: available
});
});