perf(过滤器):按review优化

This commit is contained in:
fit2cloud-chenyw 2022-11-09 10:59:02 +08:00 committed by GitHub
parent 56d25af37c
commit e76788780a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,16 +271,16 @@ class TimeDateRangeServiceImpl extends WidgetService {
}
formatDynamicTimes(values, element) {
if (!values || !values.length || !element.options.attrs.default.isDynamic) {
if (!values?.length || !element.options.attrs.default.isDynamic) {
return values
}
const baseTime = new Date('2022-11-09 00:00:00.000').getTime()
const baseTime = +new Date('2022-11-09 00:00:00.000')
let labelFormat = 'yyyy-MM-dd'
if (element.options.attrs.showTime && element.options.attrs.accuracy) {
labelFormat = labelFormat + ' ' + element.options.attrs.accuracy
}
let start = values[0]
let end = values[1]
let [ start, end ] = values
const attrs = element.options.attrs
if (attrs.default.sDynamicSuffixTime && attrs.default.isDynamic && attrs.default.dkey === 4 && attrs.showTime) {