From f42dc9de07a1e2c0f495b6801c7cf66af4d26e95 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 22 Jul 2023 13:48:21 +0200 Subject: [PATCH] Fix timerangeselect crashing when it get's a epoch timerange --- src/components/ftbot/TimeRangeSelect.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/ftbot/TimeRangeSelect.vue b/src/components/ftbot/TimeRangeSelect.vue index 440e3e80..f442562f 100644 --- a/src/components/ftbot/TimeRangeSelect.vue +++ b/src/components/ftbot/TimeRangeSelect.vue @@ -64,12 +64,16 @@ const timeRange = computed(() => { function updateInput() { const tr = props.modelValue.split('-'); 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 { dateFrom.value = ''; } 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 { dateTo.value = ''; }