From 7e623d919e9dabace8a8a3d18537a84e4205c90c Mon Sep 17 00:00:00 2001 From: ThatHurleyGuy Date: Wed, 15 Nov 2023 12:10:18 +0000 Subject: [PATCH] fix(filters): infinite loop when creating filters with dates (#3061) Rather than putting in a truncated version of the date/time with `startDate.getDate`, use the iso formatted version which includes the timezone data. I have no idea if this has ramifications elsewhere in the app, but it solves the problems I was seeing. Co-authored-by: Sean Hurley Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/3061 Reviewed-by: konrad Co-authored-by: ThatHurleyGuy Co-committed-by: ThatHurleyGuy --- src/components/project/partials/filters.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/project/partials/filters.vue b/src/components/project/partials/filters.vue index 49ea31f66..64b869895 100644 --- a/src/components/project/partials/filters.vue +++ b/src/components/project/partials/filters.vue @@ -412,10 +412,10 @@ function prepareDate(filterName, variableName) { const endDate = new Date(params.value.filter_value[foundDateEnd]) filters.value[variableName] = { dateFrom: !isNaN(startDate) - ? `${startDate.getFullYear()}-${startDate.getMonth() + 1}-${startDate.getDate()}` + ? `${startDate.getUTCFullYear()}-${startDate.getUTCMonth() + 1}-${startDate.getUTCDate()}` : params.value.filter_value[foundDateStart], dateTo: !isNaN(endDate) - ? `${endDate.getFullYear()}-${endDate.getMonth() + 1}-${endDate.getDate()}` + ? `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}` : params.value.filter_value[foundDateEnd], } }