bootstrap datepicker change date event doesnt fire up when manually editing dates or clearing date

前端 未结 9 2125
离开以前
离开以前 2020-12-09 08:47


        
相关标签:
9条回答
  • 2020-12-09 09:23

    Depending which date picker for Bootstrap you're using, this is a known bug currently with this one:

    Code: https://github.com/uxsolutions/bootstrap-datepicker

    (Docs: https://bootstrap-datepicker.readthedocs.io/en/latest/)

    Here's a bug report:

    https://github.com/uxsolutions/bootstrap-datepicker/issues/1957

    If anyone has a solution/workaround for this one, would be great if you'd include it.

    0 讨论(0)
  • 2020-12-09 09:24

    I have this version about datetimepicker https://tempusdominus.github.io/bootstrap-4/ and for any reason doesn`t work the change event with jquery but with JS vanilla it does

    I figure out like this

    document.getElementById('date').onchange = function(){ ...the jquery code...}
    

    I hope work for you

    0 讨论(0)
  • 2020-12-09 09:27

    The new version has changed.. for the latest version use the code below:

    $('#UpToDate').datetimepicker({
            format:'MMMM DD, YYYY',
            maxDate:moment(),
            defaultDate:moment()            
        }).on('dp.change',function(e){
            console.log(e);
        });
    
    0 讨论(0)
提交回复
热议问题