From fa1da72ba6c0acf01685c9d5431ccd4cc8bfac12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Tue, 16 Jul 2024 14:09:35 +0200 Subject: [PATCH] fix missing group in timezones with negative offset (#2026) * fix missing group in timezones with negative offset SDESK-7337 * revert extra changes --- client/apps/Planning/PlanningList.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/apps/Planning/PlanningList.tsx b/client/apps/Planning/PlanningList.tsx index e7a0b3423..331bc6db2 100644 --- a/client/apps/Planning/PlanningList.tsx +++ b/client/apps/Planning/PlanningList.tsx @@ -186,16 +186,14 @@ export class PlanningListComponent extends React.PureComponent { { - const dateFilter = currentSearch.advancedSearch?.dates?.start?.toDate() - ?? new Date(); + const dateFilter = currentSearch.advancedSearch?.dates?.start?.toDate() ?? new Date(); - dateFilter.setHours(0, 0, 0, 0); + dateFilter.setUTCHours(0, 0, 0, 0); // group date is UTC 00:00:00 return groups.filter((group) => { - const dateStringToJSDate = new Date(group.date); + const groupDate = new Date(group.date); - dateStringToJSDate.setHours(0, 0, 0, 0); - return dateStringToJSDate >= dateFilter; + return groupDate >= dateFilter; }); })()} onItemClick={openPreview}