Skip to content

Commit

Permalink
add some error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Nov 26, 2024
1 parent c8cb898 commit a25f6f3
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions assets/js/components/Dashboard/PaMessageForm/MainForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,20 @@ const MainForm = ({
Start date/time needs to be before the end date/time
</Form.Control.Feedback>
</div>
<Form.Control
type="time"
className="time-picker picker"
value={startTime}
onChange={(event) => setStartTime(event.target.value)}
/>
<div className="validation-group">
<Form.Control
type="time"
className="time-picker picker"
value={startTime}
onChange={(event) => setStartTime(event.target.value)}
isInvalid={
validated && !moment(startTime, "HH:mm").isValid()
}
/>
<Form.Control.Feedback type="invalid">
Start time needs to be in the correct format.
</Form.Control.Feedback>
</div>
<Button
className="service-time-link"
variant="link"
Expand Down Expand Up @@ -246,12 +254,20 @@ const MainForm = ({
Date is in the past.
</Form.Control.Feedback>
</div>
<Form.Control
type="time"
className="time-picker picker"
value={endTime}
onChange={(event) => setEndTime(event.target.value)}
/>
<div className="validation-group">
<Form.Control
type="time"
className="time-picker picker"
value={endTime}
onChange={(event) => setEndTime(event.target.value)}
isInvalid={
validated && !moment(endTime, "HH:mm").isValid()
}
/>
<Form.Control.Feedback type="invalid">
End time needs to be in the correct format.
</Form.Control.Feedback>
</div>
<Button
className="service-time-link"
variant="link"
Expand Down

0 comments on commit a25f6f3

Please sign in to comment.