JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q47614F
  • License MIT

在 dayjs 基础上封装的常用日期操作类库。

Package Exports

  • @vtils/date

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vtils/date) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

logo

NPM Version Build Status Coverage Status Size Gzip Size License

dayjs 基础上封装的常用日期操作类库。

https://fjc0k.github.io/vtils/date

安装

# yarn
yarn add @vtils/date

# or, npm
npm i @vtils/date --save

你也可通过 CDN 安装,然后使用全局变量 vd 访问相关工具:

<script src="https://cdn.jsdelivr.net/npm/@vtils/date@2.36.0/lib/index.umd.min.js" crossorigin="anonymous"></script>

目录

👇 👇 👇 👇
formatDate toDayjs

列表

formatDate

源码 | API | 回目录

格式化日期。

formatDate('2019-9-1', 'YYYY年M月D日') // => 2019年9月1日

toDayjs

源码 | API | 回目录

转换输入的日期为 Dayjs 实例。

// 字符串
toDayjs('2019-9-1')
// Date 实例
toDayjs(new Date(2019, 8, 1))
// unix 时间戳
toDayjs(1569643555)
// Dayjs 实例
toDayjs(dayjs())

许可

MIT ©️ Jay Fong