JSFiddle - React, Tailwind, and code Playground

by praveen_jegan

HTML

<input id="myinput" type="text" placeholder="dd-mm-yyyy" />

JavaScript

//construct datepicker
$(document).ready(function(){
$("#myinput").datepicker({minDate:new Date()});
//later on, a seperate event changes the maxDate property
//but this 'clears' the existing value in the textbox!
});
$("#myinput").datepicker("option","maxDate", new Date());