0

I'm using Bootstrap.v3.Datetimepicker v4.17.43 in MVC 4.5 project. I set it up as follows:

    $(function() {
        var decDate = new Date(new Date().getFullYear(), 11, 31);
        $("#MyDatePicker")
            .datetimepicker({
                viewMode: 'years',
                format: 'MM/YYYY',
                defaultDate: decDate
            });
    });

This initially works as expected, showing only the years. However when clicking a second time, it reverts to show days. I uninstalled all my jquery and bootstrap and reinstalled it from scratch making sure I got the latest stable versions (using Nuget Install) (jquery v3.1.1, bootstrap v3.3.7, bootstrap-datetimepicker v4.17.43). Is there anything I'm missing here?

JohnCambell
  • 633
  • 8
  • 23
  • Where your all code ? you must need to show html & css or make a Sniper or Jsfiddle. [check it](http://stackoverflow.com/help/how-to-ask) – MD Ashik Nov 09 '16 at 18:48
  • This is a [known bug](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1850) affecting version `4.17.42` and `4.17.43`. You can modify datetimepicker code as suggested on github or use older version of the component like `4.17.37`. The same problem was described [here](http://stackoverflow.com/q/40396433/4131048) – VincenzoC Nov 09 '16 at 19:51

0 Answers0