Skip to content

Commit

Permalink
Fix error when changing date in bulk edit metadata
Browse files Browse the repository at this point in the history
Fixes opencast#1099.

Trying to change the start date for two or more events
at the same time would cause the app to crash (See opencast#1099).
This fixes that.
  • Loading branch information
Arnei committed Feb 4, 2025
1 parent c3cc2f7 commit 0520c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/shared/wizard/RenderField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ const EditableDateValue = ({
setEditMode: (e: boolean) => void
showCheck?: boolean,
handleKeyDown: (event: React.KeyboardEvent, type: string) => void
}) => editMode ? (
}) =>
editMode ? (
<div>
<DatePicker
autoFocus
selected={typeof field.value === "string" ? parseISO(field.value) : field.value}
selected={!isNaN(Date.parse(field.value)) ? new Date(field.value) : null}
onChange={(value) => setFieldValue(field.name, value)}
onClickOutside={() => setEditMode(false)}
showTimeInput
Expand Down

0 comments on commit 0520c1f

Please sign in to comment.