JSFiddle - React, Tailwind, and code Playground
by bopperben
HTML
<label for="startDate">Date :</label>
<input name="startDate" id="startDate" class="date-picker" />
CSS
.ui-datepicker-calendar {
display: none;
}
JavaScript
$(function () {
$('.date-picker').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
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));
}
});
});