Moment.js浏览器是否独立? [英] Is moment.js browser independent?
问题描述
javascript时间库 moment.js 函数是否与所使用的浏览器无关?我已经遇到了Javascript本地Date对象在不同浏览器(特别是Chrome和IE)之间的行为方式不同(主要是关于时区)的问题.我还阅读了其他有关JavaScript Date对象不能与浏览器无关的问题:
Does the javascript time library moment.js function independent of which browser you are using? I've already experienced issues with Javascripts native Date object behaving differently (mostly regarding timezones) between different browsers, specifically Chrome and IE. I've also read other issues with the javascript Date object not being browser agnostic:
- javascript date.parse Chrome和其他浏览器的差异
-等...
由于momentjs是一个JavaScript库,所以我认为它的功能与运行哪个浏览器无关.
Being that momentjs is a javascript library, I would think that it will function the same independent of which browser is executing it.
推荐答案
Even though it relies on different ways to provide the same functionality, the behavior should be the same in the browsers they describe in the documentation here:
Moment旨在在浏览器和Node.js中均可使用.
Moment was designed to work both in the browser and in Node.js.
所有代码都应在这两种环境中都可以工作,并且所有单元测试都必须在这两种环境中运行.
All code should work in both of these environments, and all unit tests are run in both of these environments.
当前,ci系统使用以下浏览器:Windows XP上的Chrome,Windows 7上的IE 8、9和10,Windows 10上的IE 11,Linux上的最新Firefox和OSX 10.8和10.11上的最新Safari.
Currently the following browsers are used for the ci system: Chrome on Windows XP, IE 8, 9, and 10 on Windows 7, IE 11 on Windows 10, latest Firefox on Linux, and latest Safari on OSX 10.8 and 10.11.
这篇关于Moment.js浏览器是否独立?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!