JS dateObject.getTime is not a function

news/2024/7/19 15:42:25 标签: js, dateObject.getTime is not a fu

dateObject.getTime is not a function
这个错误出现的原因是通过接口或者初始化数据的时候获取的数据由date变为了string
程序校验string类型数据没有getTime方法,所以检验出错。
最简单的方法就是,通过string to date 还原数据类型 new Date('2019-11-11 09:41:13')
或者通过取出校验的rule,一般是因为校验rule中含有type类型为date的校验才会出现以上错误。


http://www.niftyadmin.cn/n/1162501.html

相关文章

SpringBoot 通过spring starter project 创建springboot项目时报错 connect timed out

根据报错信息可知是创建项目时建模信息获取超时,解决方案: 1. 加长spring网络连接时长 eclipse > window > preferences > spring > beans support > 将timeout时间从默认的60 改为600 2. 设置eclipse连接网络方式 eclipse > wind…

处理The requested profile pom.xml could not be activated because it does not exist 问题

Eclipse打包SpringBoot项目出现这个报错。 1. 一般情况可以通过右键项目 > Properties > Maven > 删除文本框内的文字pom.xml > Apply 处理 2. 如果报错信息具体到提示:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin 则说明…

Spring 常见文件上传

文件上传 1. springmvc中使用commons-fileupload 与 commons-io完成文件上传 /*** 文件上传需要使用到两个jar包:* 1. commons-fileupload.jar* 2. commons-io.jar* 配置springmvc的配置文件-配置文件上传的解析器 CommensMultipartResolver* throws IOExce…

Spring 常用注解解释

A Autowired可以自动帮把bean里面引用的对象的setter/getter方法省略,它会自动帮你set/get。注释进行自动注入时,spring容器中匹配的候选Bean数目必须有且仅有一个。否则将抛出BeanCreationException异常默认先按byType进行匹配,如果发现找到…

module.exports、exports、export default、export、require、import 区别和不同之处

在es5中,用 module.exports 和 exports 导出模块,用 require 导入模块。 在es6中,新增 export default 和 export 导出模块,用 import 导入模块。 如果开发环境支持es6语法,用es5的 module.exports 和 exports 导出的模…

JS 添加有效身份证验证

/*** certificate 身份证识别*/ export function IdentifyCertificate(cardNo) {let idCard cardNo.toString();let province {11: "北京",12: "天津",13: "河北",14: "山西",15: "内蒙古",21: "辽宁",22: &quo…

node 及 npm 版本升级

1. 单独升级npm 1.1 查看npm版本npm -v1.2 升级npm版本npm install -g npm2. 升级node升级node的同时会连带npm一同升级官网下载node版本地址: https://nodejs.org/en/download/版本: LTS 稳定版版本: Current 最新版本操作:2.1 通…

es6 类的导出、引入以及继承

导出的关键字 : export 类名举例:export class Name {...}导入的关键字: import { 类名或模块名称 } from 文件相对地址举例:import { Name, Location } from ./userinfo;对于导入模块名称重复的处理:重命名&#xff…