mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-05 19:41:37 +08:00
refactor: change date utility libary: moment to date-fns
This commit is contained in:
parent
cfd0b38a53
commit
0e61d8c247
@ -18,9 +18,9 @@
|
|||||||
"ant-design-vue": "^1.0.3",
|
"ant-design-vue": "^1.0.3",
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"clipboard": "^2.0.1",
|
"clipboard": "^2.0.1",
|
||||||
|
"date-fns": "^1.29.0",
|
||||||
"enquire.js": "^2.1.6",
|
"enquire.js": "^2.1.6",
|
||||||
"mockjs": "^1.0.1-beta3",
|
"mockjs": "^1.0.1-beta3",
|
||||||
"moment": "^2.22.2",
|
|
||||||
"pouchdb": "^7.0.0",
|
"pouchdb": "^7.0.0",
|
||||||
"viser-vue": "^2.2.5",
|
"viser-vue": "^2.2.5",
|
||||||
"vue": "^2.5.17",
|
"vue": "^2.5.17",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
const data = []
|
const data = []
|
||||||
const beginDay = new Date().getTime()
|
const beginDay = new Date().getTime()
|
||||||
@ -18,7 +18,7 @@ const beginDay = new Date().getTime()
|
|||||||
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
||||||
for (let i = 0; i < fakeY.length; i += 1) {
|
for (let i = 0; i < fakeY.length; i += 1) {
|
||||||
data.push({
|
data.push({
|
||||||
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
|
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'YYYY-MM-DD'),
|
||||||
y: fakeY[i]
|
y: fakeY[i]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
const data = []
|
const data = []
|
||||||
const beginDay = new Date().getTime()
|
const beginDay = new Date().getTime()
|
||||||
@ -18,7 +18,7 @@ const beginDay = new Date().getTime()
|
|||||||
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
||||||
for (let i = 0; i < fakeY.length; i += 1) {
|
for (let i = 0; i < fakeY.length; i += 1) {
|
||||||
data.push({
|
data.push({
|
||||||
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
|
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'YYYY-MM-DD'),
|
||||||
y: fakeY[i]
|
y: fakeY[i]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -2416,6 +2416,10 @@ data-urls@^1.0.0:
|
|||||||
whatwg-mimetype "^2.0.0"
|
whatwg-mimetype "^2.0.0"
|
||||||
whatwg-url "^6.4.0"
|
whatwg-url "^6.4.0"
|
||||||
|
|
||||||
|
date-fns@^1.29.0:
|
||||||
|
version "1.29.0"
|
||||||
|
resolved "http://registry.npm.taobao.org/date-fns/download/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
|
||||||
|
|
||||||
date-now@^0.1.4:
|
date-now@^0.1.4:
|
||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "http://registry.npm.taobao.org/date-now/download/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
resolved "http://registry.npm.taobao.org/date-now/download/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
||||||
@ -5654,7 +5658,7 @@ mockjs@^1.0.1-beta3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
commander "*"
|
commander "*"
|
||||||
|
|
||||||
moment@^2.21.0, moment@^2.22.2:
|
moment@^2.21.0:
|
||||||
version "2.22.2"
|
version "2.22.2"
|
||||||
resolved "http://registry.npm.taobao.org/moment/download/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
|
resolved "http://registry.npm.taobao.org/moment/download/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user