Tue Apr 18 08:25:00 UTC 2023 inscode

上级 4b07d85b
...@@ -22,11 +22,15 @@ export default { ...@@ -22,11 +22,15 @@ export default {
this.result = '' this.result = ''
const dateList = this.txtDate.split(/\n/) const dateList = this.txtDate.split(/\n/)
for (let dateStr of dateList) { for (let dateStr of dateList) {
const curArr = dateStr.split('-') if(!dateStr) {
const start = new Date(`2023-03-01 ${curArr[0]}`).getTime() this.result += '<hr>'
const end = new Date(`2023-03-01 ${curArr[1]}`).getTime() } else {
const curArr = dateStr.split('-')
const start = new Date(`2023-03-01 ${curArr[0]}`).getTime()
const end = new Date(`2023-03-01 ${curArr[1]}`).getTime()
this.result += '<p>' + `<span style="font-weight: 600; color: green;width: 120px; display:inline-block;margin-right: 16px;">${dateStr}</span>${parseFloat((end-start)/1000/60)}分钟` + '</p>' this.result += '<p>' + `<span style="font-weight: 600; color: green;width: 120px; display:inline-block;margin-right: 16px;">${dateStr}</span>${parseFloat((end-start)/1000/60)}分钟` + '</p>'
}
} }
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册