Skip to content

Commit

Permalink
新增dayjs的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
adaex committed Aug 10, 2021
1 parent ac9ce90 commit 3f399a8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"lint": "echo lint",
"prettier": "prettier -w ."
},
"dependencies": {},
"dependencies": {
"dayjs": "^1.10.6"
},
"devDependencies": {
"miniprogram-api-typings": "^3.4.2",
"prettier": "^2.3.2",
Expand Down
6 changes: 6 additions & 0 deletions src/dayjs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as dayjs from 'dayjs'
import * as relativeTime from 'dayjs/plugin/relativeTime'

dayjs.extend(relativeTime)

export { dayjs }
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as component } from './component'
export { default as coreConfig } from './config'
export { dayjs } from './dayjs'
export { default as die } from './die'
export { default as echo } from './echo'
export { Gateway } from './gw/Gateway'
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# yarn lockfile v1


dayjs@^1.10.6:
version "1.10.6"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63"
integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==

miniprogram-api-typings@^3.4.2:
version "3.4.2"
resolved "https://registry.yarnpkg.com/miniprogram-api-typings/-/miniprogram-api-typings-3.4.2.tgz#625460c4bde4a4c60162cc04dc05636cab6487b4"
Expand Down

0 comments on commit 3f399a8

Please sign in to comment.