datejs 与 Jquery/全球化
有人可以列出使用一种方法相对于另一种方法的优缺点吗? (www.datejs.com 与 https://github.com/jquery/globalize)。我所知道的是 Jquery/globalize 比 datejs 支持更多的文化。
Could someone list the pros and cons of using one over the other. (www.datejs.com vs. https://github.com/jquery/globalize). All I knew is Jquery/globalize supports more culture than datejs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以同时使用它们。 DateJS 使对日期对象进行数学运算更加方便,并且还提供了一些显示日期的功能。 Globalize 提供了显示不同文化日期的功能。
You can use both of them together. DateJS makes it much more convenient to do math on date objects, and also provides some functionality for displaying dates. Globalize provides functionality for displaying dates for different cultures.
Globalize 不仅支持日期/时间格式和解析(不同的日历系统,在相关字段、数字、货币、百分比格式、翻译字符串、检查给定语言是否是从右到左书写的自动转换的不同日历系统)。它写得相当好,支持 350 多种文化。该项目相当活跃。
DateJS 支持较少的文化,仅支持日期/时间格式化、解析和操作以及时区转换(Globalize 不支持)。该项目不太活跃,最后一个快照相当旧(并标记为 Alpha 版本)。这看起来就像 JavaScript 的 Joda Time 等价物,看起来确实不错,但是......
幸运的是,正如本所说,你可以将它们结合在一起。
Globalize supports more than just Date/Time formatting and Parsing (different Calendar systems with automatic conversion in the related field, number, currency, percentage formatting, translating strings, checking if given language is written Right-To-Left). It is fairly well-written and supports more than 350 culture. The project is quite active.
DateJS supports less cultures and only Date/Time formatting, parsing and manipulating as well as time zones conversion (unsupported by Globalize). The project is less active and the last snapshot is rather old (and marked as Alpha version). It seems like Joda Time equivalent for JavaScript and it really seems nice, but...
Fortunately, as Ben said you can combine them together.