new Date().format("YYYY-mm-dd")
javascript调用上述代码报错,(intermediate value).Format is not a function。
意思是说Format不是一个方法。
ES6已经去掉此方法了,要使用的话,需要添加第三方库。
解决方法
去github上下载依赖,并添加到项目中去,然后使用<script>标签进行引用
https://github.com/jacwright/date.format
new Date().format("YYYY-mm-dd")
javascript调用上述代码报错,(intermediate value).Format is not a function。
意思是说Format不是一个方法。
ES6已经去掉此方法了,要使用的话,需要添加第三方库。
解决方法
去github上下载依赖,并添加到项目中去,然后使用<script>标签进行引用
https://github.com/jacwright/date.format
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。