Clear the value of bootstrap-datepicker

前端 未结 10 1884
甜味超标
甜味超标 2020-12-28 12:56

I am using bootstrap-datepicker from here: https://github.com/eternicode/bootstrap-datepicker

version: 2.3.2

I am having trouble to clear the date values of

10条回答
  •  星月不相逢
    2020-12-28 13:29

    I came across this thread while trying to figure out why the dates weren't being cleared in IE7/IE8.
    It has to do with the fact that IE8 and older require a second parameter for the Array.prototype.splice() method. Here's the original code in bootstrap.datepicker.js:

    clear: function(){
        this.splice(0);
    },
    

    Adding the second parameter resolved my issue:

    clear: function(){
        this.splice(0,this.length);
    },
    

提交回复
热议问题