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 
}


若文章对您有帮助,帮忙点个赞!

0
-5
发布时间 2020-09-27 21:07:09
0 条回复(回复会通过微信通知作者)
点击加载更多评论
登录 后再进行评论
(微信扫码即可登录,无需注册)