JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<div id='myDate'>
    <input type="text" type="text" class="form-control" />
</div>

JavaScript

var now = new Date();
var prevMonthFirstDate = new Date(now.getFullYear() - (now.getMonth() > 0 ? 0 : 1), (now.getMonth() - 1 + 12) % 12, 1);
var prevMonthLastDate = new Date(now.getFullYear(), now.getMonth(), 0);
$('#myDate input').datepicker({
startDate: prevMonthFirstDate,
endDate: prevMonthLastDate
});