Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
## 安装

```bash
$ npm install --save tdesign-react moment
$ npm install --save tdesign-react dayjs
$ npm install --save @formily/core @formily/react @formily/tdesign-react

```
```
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ footer: Open-source MIT Licensed | Copyright © 2019-present<br />Powered by sel
## 安装

```bash
$ npm install --save tdesign-react moment
$ npm install --save tdesign-react dayjs
$ npm install --save @formily/core @formily/react @formily/tdesign-react

```
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
]
},
"dependencies": {
"@formily/core": "^2.0.13",
"@formily/grid": "^2.1.12",
"@formily/react": "^2.0.13",
"@formily/reactive": "^2.0.13",
"@formily/shared": "^2.0.13",
"@formily/core": "^2.2.0",
"@formily/grid": "^2.2.0",
"@formily/react": "^2.2.0",
"@formily/reactive": "^2.2.0",
"@formily/shared": "^2.2.0",
"dayjs": "^1.11.5",
"mfetch": "^0.2.27",
"moment": "^2.29.4",
"react-sortable-hoc": "^2.0.0",
"react-sticky-box": "^0.9.3",
"tdesign-icons-react": "^0.1.1",
Expand Down
28 changes: 14 additions & 14 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@
"access": "public"
},
"peerDependencies": {
"@formily/core": "^2.1.9",
"@formily/react": "^2.1.9",
"@formily/reactive": "^2.1.9",
"moment": "^2.29.3",
"@formily/core": "^2.2.0",
"@formily/react": "^2.2.0",
"@formily/reactive": "^2.2.0",
"react": ">=16.8.0 || >=17.0.0",
"react-dom": ">=16.8.0",
"react-is": ">=16.8.0 || >=17.0.0",
"tdesign-icons-react": "^0.1.1",
"tdesign-react": "^0.36.3"
"tdesign-react": "^0.36.3",
"dayjs": "^1.11.5"
},
"devDependencies": {
"@formily/core": "^2.1.9",
"@formily/react": "^2.1.9",
"@formily/reactive": "^2.1.9",
"moment": "^2.29.3",
"@formily/core": "^2.2.0",
"@formily/react": "^2.2.0",
"@formily/reactive": "^2.2.0",
"react": ">=16.8.0 || >=17.0.0",
"react-dom": ">=16.8.0",
"react-is": ">=16.8.0 || >=17.0.0",
"tdesign-icons-react": "^0.1.1",
"tdesign-react": "^0.36.3"
"tdesign-react": "^0.36.3",
"dayjs": "^1.11.5"
},
"dependencies": {
"@formily/grid": "^2.1.9",
"@formily/json-schema": "2.1.9",
"@formily/reactive-react": "^2.1.9",
"@formily/shared": "^2.1.9",
"@formily/grid": "^2.2.0",
"@formily/json-schema": "2.2.0",
"@formily/reactive-react": "^2.2.0",
"@formily/shared": "^2.2.0",
"classnames": "^2.3.1",
"react-sortable-hoc": "^2.0.0",
"react-sticky-box": "^0.9.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { isArr, isFn, isEmpty } from '@formily/shared'
import moment from 'moment'
import dayjs from 'dayjs'

export const momentable = (value: any, format?: string) => {
return Array.isArray(value)
? value.map((val) => moment(val, format))
? value.map((val) => dayjs(val, format))
: value
? moment(value, format)
? dayjs(value, format)
: value
}

Expand All @@ -24,15 +24,15 @@ export const formatMomentValue = (
if (isEmpty(_format)) {
return date
}
return moment(date).format(_format)
return dayjs(date).format(_format)
} else {
if (isFn(format)) {
return format(date)
}
if (isEmpty(format)) {
return date
}
return moment(date).format(format)
return dayjs(date).format(format)
}
}
if (isArr(value)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/__builtins__/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './moment'
export * from './hooks'
export * from './portal'
export * from './loading'
export * from './pickDataProps'
export * from './dayjs'
Loading