JSFiddle - React, Tailwind, and code Playground

HTML

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

JavaScript

//construct datepicker
$("#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());