Skip to content

Commit

Permalink
fix missing group in timezones with negative offset (#2026)
Browse files Browse the repository at this point in the history
* fix missing group in timezones with negative offset

SDESK-7337

* revert extra changes
  • Loading branch information
petrjasek authored Jul 16, 2024
1 parent 72327a5 commit fa1da72
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions client/apps/Planning/PlanningList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,14 @@ export class PlanningListComponent extends React.PureComponent<IProps> {
<PlanningListSubNav />
<ListPanel
groups={(() => {
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}
Expand Down

0 comments on commit fa1da72

Please sign in to comment.