From 9322f71f94549323aa6bc070de82b41cd485d6cd Mon Sep 17 00:00:00 2001 From: Hamza <65722778+hchorfispiria@users.noreply.github.com> Date: Wed, 19 Jul 2023 07:26:19 -0400 Subject: [PATCH] MM-52793 : Search calendar selects the day before when selected for a date (#23618) --- .../search_date_suggestion/search_date_suggestion.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/channels/src/components/suggestion/search_date_suggestion/search_date_suggestion.tsx b/webapp/channels/src/components/suggestion/search_date_suggestion/search_date_suggestion.tsx index 5cf51678855..c487deef0d7 100644 --- a/webapp/channels/src/components/suggestion/search_date_suggestion/search_date_suggestion.tsx +++ b/webapp/channels/src/components/suggestion/search_date_suggestion/search_date_suggestion.tsx @@ -30,7 +30,7 @@ export default class SearchDateSuggestion extends React.PureComponent { }; handleDayClick = (day: Date) => { - const dayString = day.toISOString().split('T')[0]; + const dayString = new Date(Date.UTC(day.getFullYear(), day.getMonth(), day.getDate())).toISOString().split('T')[0]; this.props.onClick(dayString, this.props.matchedPretext); };