Skip to content

Commit fff3cff

Browse files
committed
fix(date): crash when removing the seconds (tested this time)
1 parent 59373a8 commit fff3cff

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ui/src/components/organisms/DateTimePicker.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ export function DateTimePicker({ value, setValue, id, referenceDate }: Props) {
8686
time.setMinutes(0)
8787
time.setSeconds(0)
8888
} else {
89-
time = parse(e.target.value, "HH:mm:ss", new Date())
89+
let targetValue = e.target.value
90+
if (e.target.value.split(":").length == 2) {
91+
targetValue += ":00"
92+
}
93+
94+
time = parse(targetValue, "HH:mm:ss", new Date())
9095
}
9196

9297
const newDate = new Date(value?.getTime())

0 commit comments

Comments
 (0)