JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
Start Date: <input class="questionDate" value=" 05/16/2015 ">
<br>
End Date: <input class="questionDate" value=" 05/31/2015 "><br>
JavaScript
$(function() {
$("input.questionDate").datepicker({
dateFormat: 'mm/dd/yy'
});
$("input.questionDate").each(function(){
var currentValue = $(this).val();
if(currentValue)
$(this).datepicker('setDate',new Date(currentValue));
});
$("input.questionDate").keydown(function(event) {
if(event.keyCode != 8){
event.preventDefault();
}
});
});