“未定义片刻"指的是“片刻".使用moment.js [英] "moment is not defined" using moment.js
本文介绍了“未定义片刻"指的是“片刻".使用moment.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用moment.js,但是在测试moment.js库时,我继续收到错误.
I am working with moment.js, but as I am testing the moment.js library I continue to receive an error.
var back30Days=moment().subtract(30, 'days').format("dddd, MMMM Do YYYY, h:mm:ss p");
它返回引用.format("dddd, MMMM Do YYYY, h:mm:ss p");
我已经阅读了文档,一切看起来都很好,但是当我重新加载页面时,正在使用的js无法加载.
I've read the documentation, and everything looks fine, but when I reload my page, the js I'm working with won't load.
任何提示将不胜感激!
推荐答案
最新的时刻:
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
var back30Days=moment().subtract(30, 'days').format("dddd, MMMM Do YYYY, h:mm:ss p");
console.log('back30Days --> ' + back30Days);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
这篇关于“未定义片刻"指的是“片刻".使用moment.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文