Browse Source

中断邮件时间格式按XX天XX时XX分

dev
巴林闲侠 2 years ago
parent
commit
afe384b9a4
  1. 17
      api/app/lib/schedule/alarms_push.js

17
api/app/lib/schedule/alarms_push.js

@ -64,6 +64,17 @@ module.exports = function (app, opts) {
).toPromise() :
[]
const calcMinute2DHM = (minute) => {
if (!minute && minute != 0) {
return minute
}
let dm = 24 * 60
let d = Math.floor(minute / dm)
let h = Math.floor(minute % dm / 60)
let m = (minute % dm) % 60
return `${d}${h}${m}`
}
for (let { dataValues: c } of configListRes) {
if (c.tacticsParams && c.tactics) {
if (proDebug) {
@ -526,7 +537,7 @@ module.exports = function (app, opts) {
k: '',
f: (d) => {
return d.StartTime ?
'超过' + moment().diff(moment(d.StartTime), 'minutes') + '分钟' : ''
'超过' + calcMinute2DHM(moment().diff(moment(d.StartTime), 'minutes')) : ''
}
},]
@ -572,7 +583,7 @@ module.exports = function (app, opts) {
k: '',
f: (d) => {
return d.createTime ?
'超过' + moment().diff(moment(d.createTime), 'minutes') + '分钟' : ''
'超过' + calcMinute2DHM(moment().diff(moment(d.createTime), 'minutes')) : ''
}
},]
@ -612,7 +623,7 @@ module.exports = function (app, opts) {
k: '',
f: (d) => {
return d.createTime ?
'超过' + moment().diff(moment(d.createTime), 'minutes') + '分钟' : ''
'超过' + calcMinute2DHM(moment().diff(moment(d.createTime), 'minutes')) : ''
}
},]

Loading…
Cancel
Save