JSFiddle - React, Tailwind, and code Playground

by Reigel Gallarde

HTML

<input type="text" id="datepicker">

CSS

.ui-widget{
    font-size: 0.7em;
}
td.highlight {
}
td.highlight > a {
    background: #000!important;
    color: #fff!important;
}

JavaScript

var dates = ['04/30/2010', '05/01/2010'];

$('#datepicker').datepicker({
    numberOfMonths: [2, 2],
    dateFormat: 'dd/mm/yy',
    defaultDate: new Date('04/23/2010'), // this line is for testing
    beforeShowDay: highlightDays
});

function highlightDays(date) {
    for (var i = 0; i < dates.length; i++) {
        if (new Date(dates[i]).toString() == date.toString()) {
            return [true, 'highlight'];
        }
    }
    return [true, ''];
}