datejs vs Jquery/globalize

1.1k Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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.

  • If you need to do math on dates and to display internationalized dates, use both. Have Globalize display dates that are calculated with DateJS.
  • If you just need to do math on dates and display dates in a format readable by most Internet users, use DateJS.
  • If you don't need to do math on dates (it might be that the server and APIs take care of it), but need to display internationalized dates, use Globalize.
0
On

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.