In the Bootstrap Datepicker, if you need to auto close of popup date selector,
please use the below function.
please use the below function.
/** Auto closing of POPUP on single date Selection */ var enableSingleDatePicker = function (date) { if ( (date =="" ) || (date == undefined) ) { var date = 'start_date'; } var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkout = $('#' + date).datepicker({ beforeShowDay: function (date) { return date.valueOf() >= now.valueOf(); } }).on('changeDate', function (ev) { checkout.hide(); }).data('datepicker'); };
No comments:
Post a Comment
Please post any queries and comments here.