OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Bootstrap datepicker not close automatically after picking a date

  • Thread starter Thread starter AlliceSmash
  • Start date Start date
A

AlliceSmash

Guest
I use the latest Bootstrap datepicker.js. All works fine except that when I pick a date from the drop down, it does not automatically close it. I searched web and tried to use the following function in my javascript like the following:

Code:
 $('#selectDate').datepicker({
    autoclose: true
}).on('changeDate', function (ev) {
    (ev.viewMode == 'days') ? $(this).datepicker('hide') : '';      
});

but when i use Google Chrome Dev tools, I realized that ev.viewmode was undefined. I am not sure how to move forward.

<p>I use the latest Bootstrap datepicker.js. All works fine except that when I pick a date from the drop down, it does not automatically close it. I searched web and tried to use the following function in my javascript like the following: </p>

<pre><code> $('#selectDate').datepicker({
autoclose: true
}).on('changeDate', function (ev) {
(ev.viewMode == 'days') ? $(this).datepicker('hide') : '';
});
</code></pre>

<p>but when i use Google Chrome Dev tools, I realized that ev.viewmode was undefined. I am not sure how to move forward. </p>
 

Latest posts

Top