JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css">
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css">
<p>Date: <input type="text" id="datepicker"></p>
JavaScript
$(function() {
$( "#datepicker" ).datepicker({dateFormat: "dd MM yy"});
});
var s = '';
var a = '';
$('#datepicker').change(function() {
string = document.getElementById("datepicker")
var str = string.value;
s = str.substring(0, str.length - 4);
a = str.substring( str.length -4, str.length);
document.getElementById("datepicker").value = s;
});
$("#datepicker").hover(
function () {
document.getElementById("datepicker").value = s + a;
},
function () {
document.getElementById("datepicker").value = s;
}
);