JSFiddle - React, Tailwind, and code Playground

by fnagel

HTML

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<p>Date: <input type="text" id="datepicker"></p>

JavaScript

var bookable_date=["Fri Apr 9 2021", "Sat Apr 10 2021", "Tue Apr 13 2021", "Wed Apr 14 2021", "Thu Apr 15 2021", "Fri Apr 16 2021", "Sat Apr 17 2021", "Tue Apr 20 2021"];

$(document).ready(function() {

  
	$( "#datepicker" ).datepicker({
  	dateFormat: 'D M d yy',	
    defaultDate: bookable_date[ 0 ],
		minDate: bookable_date[0],
		maxDate: bookable_date[ bookable_date.length - 1 ],
    dayNamesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  });



})


function is_date_available( formatted_date ) {
	console.log(formatted_date);
	return bookable_date.includes( formatted_date );
}