JSFiddle - React, Tailwind, and code Playground
by apaul34208
HTML
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/resources/demos/style.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css">
<p>Date:
<input type="text" id="datepicker" />
</p>
CSS
.ui-datepicker-calendar {
display: none;
}
JavaScript
$(function () {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-120:+10", // magic!
dateFormat: 'mm/yy',
onClose: function (dateText, inst) {
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
$(this).datepicker('setDate', new Date(year, month, 1));
}
});
});