博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
6 个JavaScript日期处理库
阅读量:6180 次
发布时间:2019-06-21

本文共 2616 字,大约阅读时间需要 8 分钟。

1. Later.js

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.

2. Countdown.js

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.

3. Moment.js

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.

4. Date.js

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.

5. Cubism.js

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.

6. Xdate.js

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.

 

转载地址:http://bgbda.baihongyu.com/

你可能感兴趣的文章
第一个tensorflow程序
查看>>
从问题出发看JAVA编程规范
查看>>
vue.js 实践总结(二)Render 函数
查看>>
用python来给图片加水印
查看>>
GTX Ajazz 鼠标如何在mac上设置编程键
查看>>
vuejs自定义组件+操作Dom(directive )
查看>>
【译】Swift算法俱乐部-快速排序
查看>>
Vue v-model自定义组件
查看>>
漫谈计算机组成原理(九·续)定点数的除法运算
查看>>
你该了解的TCP/IP以及HTTP
查看>>
MPAndroidChart的使用
查看>>
[译] Xcode 中的用户断点
查看>>
WEB常见的攻击方式
查看>>
使用 flutter 实现一个底部导航栏
查看>>
日记14(npm)
查看>>
每天一道leetcode27-移除元素
查看>>
linux命令行总结 + 自动备份Python程序
查看>>
使用async实现异步控制
查看>>
手动触发ngOnChanges方案
查看>>
150年前,他对拿破仑做数据可视化
查看>>