diff --git a/frontend/src/components/CustomTimePicker/RangePickerModal.tsx b/frontend/src/components/CustomTimePicker/RangePickerModal.tsx index 862d63e922..188fc5837b 100644 --- a/frontend/src/components/CustomTimePicker/RangePickerModal.tsx +++ b/frontend/src/components/CustomTimePicker/RangePickerModal.tsx @@ -3,9 +3,9 @@ import './RangePickerModal.styles.scss'; import { DatePicker } from 'antd'; import { DateTimeRangeType } from 'container/TopNav/CustomDateTimeModal'; import { LexicalContext } from 'container/TopNav/DateTimeSelectionV2/config'; -import dayjs from 'dayjs'; +import dayjs, { Dayjs } from 'dayjs'; import { useTimezone } from 'providers/Timezone'; -import { Dispatch, SetStateAction } from 'react'; +import { Dispatch, SetStateAction, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import { GlobalReducer } from 'types/reducer/globalTime'; @@ -53,22 +53,32 @@ function RangePickerModal(props: RangePickerModalProps): JSX.Element { } onCustomDateHandler(date_time, LexicalContext.CUSTOM_DATE_PICKER); }; - const { timezone } = useTimezone(); + + const rangeValue: [Dayjs, Dayjs] = useMemo( + () => [ + dayjs(minTime / 1000_000).tz(timezone.value), + dayjs(maxTime / 1000_000).tz(timezone.value), + ], + [maxTime, minTime, timezone.value], + ); + return (