js报tempusdominus 'clone' of undefined

When I remove the value of the input field, I get an error for:

TypeError: Cannot read property 'isSame' of undefined

TypeError: Cannot read property 'clone' of undefined

It seems that it read the empty value as an error

解决办法 DateTimePicker.prototype._getLastPickedDate的方法内容改成如下:


        DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate() {

            return this._dates[this._getLastPickedDateIndex()];



DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate(){

var lastDate = this._dates[this._getLastPickedDateIndex()]; if(typeof lastDate == "undefined" || lastDate == null){ lastDate = this.getMoment(); } return lastDate 


以上是 js报tempusdominus 'clone' of undefined 的全部内容, 来源链接: www.h5w3.com/116272.html