Moment.js浏览器是否独立? [英] Is moment.js browser independent?

查看:139
本文介绍了Moment.js浏览器是否独立?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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中的日期格式问题

- 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆