轻量级 JavaScript 时间日期处理库 Day.js

码农软件 · 软件分类 · 常用JavaScript包 · 2019-04-04 17:14:40

软件介绍

Day.js 是一个仅 2kb 大小的轻量级 JavaScript 时间日期处理库,和 Moment.js 的 API 设计保持完全一样。如果你曾经用过 Moment.js ,那么你已经知道如何使用 Day.js 。

dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH🇲🇲ss');

特性 

  • 和 Moment.js 相同的 API 和用法

  • 不可变数据(Immutable)

  • 支持链式操作(Chainable)

  • 仅 2kb 大小的微型库

  • 全浏览器兼容

安装

可以有如下多种方法安装使用 Day.js :

  • NPM:

npm install dayjs --save

var dayjs = require('dayjs');
dayjs().format();

  • CDN:

 <!-- Latest compiled and minified JavaScript -->
    <script src="https://unpkg.com/dayjs"></script>
    <script>
      dayjs().format();
    </script>

  • 下载到自己的服务器上:

从 https://unpkg.com/dayjs 下载最新的 Dayjs 源文件,并自行部署到你的服务器上。

本文地址:https://codercto.com/soft/d/2856.html

Algorithms of the Intelligent Web

Algorithms of the Intelligent Web

Haralambos Marmanis、Dmitry Babenko / Manning Publications / 2009-7-8 / GBP 28.99

Web 2.0 applications provide a rich user experience, but the parts you can't see are just as important-and impressive. They use powerful techniques to process information intelligently and offer featu......一起来看看 《Algorithms of the Intelligent Web》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具