I have a problem related to bootstrap3 datepicker, this is my code:
$(document).ready( /* This is the function for multi datepicker */ function () { $(document).on('focus',".datepickers", function(){ $("#searchByCreateDate").datepicker({ endDate : new Date(), beforeShow : function() { $(this).datepicker({maxDate: 0}); }, autoclose:true, altFormat: 'yy-mm-dd', format: 'yyyy-mm-dd' }); $("#searchByToDate").datepicker({ endDate : new Date(), beforeShow : function() { $(this).datepicker('option','startDate', $('#searchByCreateDate').val() ); }, altFormat: "yy-mm-dd", format: 'yyyy-mm-dd', autoclose:true }); }); } ); I have two datepickers - one for from date and second for to date. My requirement is when user selects from date then to date starts with from date and previous dates are hidden and in to date user can only select next three months in single time.