JSFiddle - React, Tailwind, and code Playground
by edwardsharp
HTML
<script src="http://momentjs.com/downloads/moment.js"></script>
<div id="datepicker"></div>
JavaScript
$(function() {
var maxDate = "2016-09-02";
$("#datepicker").datepicker({
dateFormat: "yy-mm-dd",
minDate: 0,
maxDate: maxDate,
showOtherMonths: true,
selectOtherMonths: true,
onSelect: function(date) {
d = new Date(date);
$("#datepicker").attr('data-date', (d.getDate() +1));
var d = moment(date, "YY-MM-DD");
setTimeout(function(){
$(".ui-datepicker-month").html(d.format("MMMM D,"));
}, 100);
},
onChangeMonthYear: function(date) {
console.log("onChangeMonthYear", date);
},
});
});