NEZ-3457 fix: 增加判断不同月但是相差30天以内
This commit is contained in:
@@ -557,6 +557,7 @@ export default {
|
|||||||
|
|
||||||
const moment1 = moment((minTime * 1000 - localOffset + offset * 60 * 1000))
|
const moment1 = moment((minTime * 1000 - localOffset + offset * 60 * 1000))
|
||||||
const moment2 = moment((maxTime * 1000 - localOffset + offset * 60 * 1000))
|
const moment2 = moment((maxTime * 1000 - localOffset + offset * 60 * 1000))
|
||||||
|
console.log(minTime, maxTime)
|
||||||
const isSameDay = moment1.isSame(moment2, 'day')
|
const isSameDay = moment1.isSame(moment2, 'day')
|
||||||
const isSameMonth = moment1.isSame(moment2, 'month')
|
const isSameMonth = moment1.isSame(moment2, 'month')
|
||||||
|
|
||||||
@@ -564,6 +565,8 @@ export default {
|
|||||||
return [hour, minute].join(':')
|
return [hour, minute].join(':')
|
||||||
} else if (isSameMonth) { // 同一月
|
} else if (isSameMonth) { // 同一月
|
||||||
return str + '\n' + [hour, minute].join(':')
|
return str + '\n' + [hour, minute].join(':')
|
||||||
|
} else if (maxTime - minTime <= 30 * 24 * 60 * 60) { // 不同月 相差30天以内
|
||||||
|
return str + '\n' + [hour, minute].join(':')
|
||||||
} else { // 大于等于30天
|
} else { // 大于等于30天
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user