How to select the two datepicker within a month?
I'm currently using JavaScript and Bootstrap Datepicker.
I found a working two datepicker limit within a month but not working in bootstrap-datepicker because he use other datepicker plugin.
Here's the link http://jsfiddle.net/cse_tushar/2s8XL/
Here's my code.
$(document).ready(function() {
$('.startDateTime').datetimepicker({
format: 'MMMM DD, YYYY',
icons: {
previous: "fa fa-chevron-left",
next: "fa fa-chevron-right",
},
});
$('.endDateTime').datetimepicker({
format: 'MMMM DD, YYYY',
icons: {
previous: "fa fa-chevron-left",
next: "fa fa-chevron-right",
},
});
$(".startDateTime").on("dp.change", function(e) {
$('.endDateTime').data("DateTimePicker").minDate(e.date);
});
$(".endDateTime").on("dp.change", function(e) {
$('.startDateTime').data("DateTimePicker").maxDate(e.date);
});
});
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<input type="text" id="from_period" class="form-control startDateTime" placeholder="FROM" style="font-weight: bold;">
<input type="text" id="to_period" class="form-control endDateTime" placeholder="TO" style="font-weight: bold;">