Skip to content

Commit

Permalink
fix date range picker timezone issue
Browse files Browse the repository at this point in the history
`new Date(isoString)` assumes that `isoString` is in UTC.
We wanted to parse it in the local timezone, which is what luxon does here.
  • Loading branch information
JGreenlee committed May 24, 2024
1 parent c803973 commit b3e80df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/js/diary/list/DateSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const DateSelect = ({ mode, onChoose, ...rest }: Props) => {
}, [pipelineRange]);

const queriedRangeAsJsDates = useMemo(
() => queriedDateRange?.map((d) => new Date(d)),
() => queriedDateRange?.map((d) => DateTime.fromISO(d).toJSDate()),
[queriedDateRange],
);

Expand Down

0 comments on commit b3e80df

Please sign in to comment.