Date参数接收报错rejected value [yyyy-mm-dd]
Posted yyjspace
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Date参数接收报错rejected value [yyyy-mm-dd]相关的知识,希望对你有一定的参考价值。
可能原因:
1.前端(IE下不支持new Date())
解决:引用时间插件moment.js
this.user.establishedTime = moment(this.user.establishedTime).format("l");
if (this.user.establishedTime) {
this.formData.append("establishedTime",new Date(this.user.establishedTime));
}
2.后台(所传日期不符合格式)
解决:引用组件格式化日期@DateTimeFormat(pattern="yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date beginDate;
以上是关于Date参数接收报错rejected value [yyyy-mm-dd]的主要内容,如果未能解决你的问题,请参考以下文章
Failed to convert property value of type ‘java.lang.String‘ to required type ‘int‘ for property(代码片段
Xshell报错“The remote SSH server rejected X11 forwarding request.”
Ajax使用formdata异步上传文件,报错the request was rejected because no multipart boundary was found
解决上传代码到GitHub报错Push rejected: Push to origin/master was rejected
springboot 提交时间字符串报错 Failed to convert property value of type ‘java.lang.String‘ to required ‘Date‘