How to get current viewMode property from "Bootstrap Datepicker"? I initialize the control with viewMode= 'years' , and I want to close the datepicker on the changeDate event only when viewMode='days' .
The user selects a year, then a month, and finally a day. At this point, control should be closed.
This is the code:
$("#date").datepicker( {viewMode: 'years', format: 'dd/mm/yyyy' }); $('#date').on('changeDate', function (ev) {
Can anyone help?
source share