JSFiddle - React, Tailwind, and code Playground

HTML

Date: <input type="text" id="thedate"/>

<button id="checkDate">Check this month or not</button>

JavaScript

$('#thedate').datepicker({minDate:0});

$('#checkDate').bind('click', function() {
    var selectedDate = $('#thedate').datepicker('getDate');
    var d= new Date(selectedDate);
    var today = new Date();
    if (d.getMonth() == today.getMonth()) {
        alert('this month');
    } else {
        alert('Not this  month');
    }
    alert(d.getDate() == today.getDate() ?'today':'not today')
});