JSFiddle - React, Tailwind, and code Playground

by praveen_jegan

HTML

In the below datepicker select a date any month other that the current month. <br/>
Then click the datepicker again.<br/>
The datepicker calendar will show today's month and year calendar and not the previously selected date's calendar.<br/>
<input type="text" id="a" />

CSS

.ui-datepicker-today a.ui-state-highlight {
    border-color: #d3d3d3;
    background: #e6e6e6 url(/themeroller/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;;
    color: #555555;    
}

JavaScript

/*
In the below datepicker select a date any month other that the current month. Then click the datepicker again. The datepicker calendar will show today's month and year calendar and not the previously selected date's calendar
*/
$(function() {
    $('#a').datepicker({
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        dateFormat: 'MM yy',
    });
});