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 }
若文章对您有帮助,帮忙点个赞!
(微信扫码即可登录,无需注册)