# add cur time with moment.js

This commit is contained in:
xianfuxing 2018-08-22 23:08:12 +08:00
parent 8538e02f0c
commit 43ece7e820
2 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,7 @@
"jsonlint": "1.6.3",
"jszip": "3.1.5",
"mockjs": "1.0.1-beta3",
"moment": "^2.22.2",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"screenfull": "3.3.2",

View File

@ -47,6 +47,7 @@
</template>
<script>
import moment from 'moment'
export default {
name: 'screen',
props: {
@ -63,7 +64,9 @@ export default {
},
computed: {
lastTime() {
return this.lastItem.calc_time.substr(0, 16).split('')
const curTime = moment().format('YYYY-MM-DD HH:mm')
return curTime.split('')
// return this.lastItem.calc_time.substr(0, 16).split('')
},
lastCount() {
const count = this.lastItem.mosq_count