错误:
TypeError: value.getTime is not a function,iview验证时间时出现此错误
原因:
iview验证时必须传入时间格式,否则就会出现此问题
解决:
在修改时就把时间转换成时间格式,我的日期格式是‘20180517’格式,这样的必须先转换成日期类格式才能new data(),否则new data()无法识别
if (this.formValidate.stopGroupDay != null && this.formValidate.stopGroupDay != '') {
this.formValidate.stopGroupDay = new Date(this.formValidate.stopGroupDay.replace(/(\d{4})(\d{2})(\d{2})/g,'$1-$2-$3'));
}