This is the coding that I set for the date :
<div class="form-group">
<label for="BookingDate">Date</label>
<input class="form-control datepicker" name="fld_booking_date" id="fld_booking_date" placeholder="mm/dd/yyyy" value="" required>
</div>
This is the script that I use to disable date selection, based on https://dzone.com/articles/disable-dates-in-datepicker & http://jsfiddle.net/sibeeshvenu/gj90f1bm/
var array = ["2023-01-04","2023-01-05","2023-01-09", "2023-01-10", "2023-01-11", "2023-01-12", "2023-01-13"]
$('input.datepicker').datepicker({
beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
return [ array.indexOf(string) == -1 ]
}
});
I want to fetch the dates from database as the array, so that the dates can be disabled for selection (using dates that already in database, instead of those 7 dates). I am totally new in this, so I hope anyone can somewhat having way to get array to fetch the dates from database. Thank you so much, totally appreciated ~