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>
<p>Today: <span id='today'></span></p>
<p>Tomorrow: <span id='tomorrow'></span></p>
<p>Date: <input type="text" id="datepicker" /> (tomorrow will be highlighted as the "today" date)</p>
JavaScript
$(function() {
var today = new Date(),
tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate()+1);
$('#today').text(today.toDateString());
$('#tomorrow').text(tomorrow.toDateString());
$( "#datepicker" ).datepicker({
showButtonPanel: true,
localToday: tomorrow // new option
});
// courtesy of http://stackoverflow.com/a/7613795/648350
$.datepicker._gotoToday = function(id) {
var target = $(id);
var inst = this._getInst(target[0]);
if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
inst.selectedDay = inst.currentDay;
inst.drawMonth = inst.selectedMonth = inst.currentMonth;
inst.drawYear = inst.selectedYear = inst.currentYear;
}
else {
var date = inst.settings.localToday || new Date(); // CHANGED. use new option, or use new Date
inst.selectedDay = date.getDate();
inst.drawMonth = inst.selectedMonth = date.getMonth();
inst.drawYear = inst.selectedYear = date.getFullYear();
this._setDateDatepicker(target, date);
this._selectDate(id, this._getDateDatepicker(target));
}
this._notifyChange(inst);
this._adjustDate(target);
}
// from jqueryui 1.11.0 source
$.datepicker._generateHTML = function(inst) {
var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
printDate, dRow, tbody, daySettings, otherMonth, unselectable,
tempDate = inst.settings.localToday || new Date(), // CHANGED. use new option, or use new Date
today = this._daylightSavingAdjust(
new...