轻量级 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://www.codercto.com/soft/d/2856.html

Inside the C++ Object Model

Inside the C++ Object Model

Stanley B. Lippman / Addison-Wesley Professional / 1996-5-13 / USD 64.99

Inside the C++ Object Model focuses on the underlying mechanisms that support object-oriented programming within C++: constructor semantics, temporary generation, support for encapsulation, inheritanc......一起来看看 《Inside the C++ Object Model》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具