6 个JavaScript日期处理库

jopen 11年前

1. Later.js

6 个JavaScript日期处理库
Later.js, a stadalone JavaScript library, offers an advanced usage for triggering recurring events and can easily replace both methods for many projects. Also, the library accepts cron expressions or user friendly schedules (like “every 10 seconds”). P.S. It works both in the browser and Nodejs.

Source

2. Countdown.js

6 个JavaScript日期处理库
Countdown.js is a JavaScript library for calculating and displaying the timespan between two dates. The library calculates the value continuously considering “the time goes on” and keeps generating an accurate output. It can provide the time span in many formats like milliseconds, seconds, minutes, hours, days, weeks and even millennias. There are methods for displaying it as an English sentence like “3 years, 6 months, 21 days, 10 hours, and 32 minutes”. The countdown can be reset easily and there are callbacks both on startand end.

Source

3. Moment.js

6 个JavaScript日期处理库
Moments.js is a feature-rich JavaScript library for working with dates (parsing, manipulating, and formatting them). It works both in the browser and server with NodeJS as all code is compatible with both of the environments. The library can easily convert any given date to many different formats, add/subtract dates, hours, etc. and has methods for displaying user-friendly date/times like “in 5 days” Moment.js is multilanguage and any new languages can be easily added by editing a language file.

Source

4. Date.js

6 个JavaScript日期处理库
Datejs is an open-source JavaScript Date Library. With simple to use commands, Datejs provides many useful date functions like: last December, next Thursday, +10years, & many date format conversions. Date objects in JavaScript are generally problematic as they may require complicated calculations to run. Datejs is absolutely a life-saver in this area.

Source

5. Cubism.js

6 个JavaScript日期处理库
Cubism.js is a plugin for D3.js, a JavaScript visualization library for HTML and SVG, to display time series in real-time. It requests the data incrementally by polling only the most recent values and reduces the load on the server. Charts are rendered incrementally as well by shifting charts one pixel each time to the left. Cubism is data-source agnostic. It has built-in support for Graphite and Cube, and can be readily extended to fetch data from other sources.

Source

6. Xdate.js

6 个JavaScript日期处理库
XDate is another library similar to String.js but for parsing, formatting and manipulating dates. The library is standalone, only 2.9kb gzipped, has chaining support and brings very handy methods like: getting date values, adding-subtracting dates, calculating differences, and getting outputs in multiple formats. It also has a wide set of methods for working with UTC values.

Source