Fix timerangeselect crashing when it get's a epoch timerange

This commit is contained in:
Matthias 2023-07-22 13:48:21 +02:00
parent 2bfa234362
commit f42dc9de07

View File

@ -64,12 +64,16 @@ const timeRange = computed(() => {
function updateInput() { function updateInput() {
const tr = props.modelValue.split('-'); const tr = props.modelValue.split('-');
if (tr[0]) { if (tr[0]) {
dateFrom.value = timestampToDateString(dateFromString(tr[0], 'yyyyMMdd')); dateFrom.value = timestampToDateString(
tr[0].length === 8 ? dateFromString(tr[0], 'yyyyMMdd') : parseInt(tr[0]) * 1000,
);
} else { } else {
dateFrom.value = ''; dateFrom.value = '';
} }
if (tr.length > 1 && tr[1]) { if (tr.length > 1 && tr[1]) {
dateTo.value = timestampToDateString(dateFromString(tr[1], 'yyyyMMdd')); dateTo.value = timestampToDateString(
tr[1].length === 8 ? dateFromString(tr[1], 'yyyyMMdd') : parseInt(tr[1]) * 1000,
);
} else { } else {
dateTo.value = ''; dateTo.value = '';
} }