Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
fix: end date validation show error when it shouldn't
Browse files Browse the repository at this point in the history
  • Loading branch information
Bricklou committed Dec 6, 2023
1 parent 499200b commit 797b61c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/meeting/MeetingUpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Button } from "../base/button/button";
import { Calendar, Edit3, Loader2, Pencil, X } from "lucide-react";
import { useForm } from "react-hook-form";
import { formatDatetimeToInputValue as dateForInput } from "@/utils/date";
import { addMinutes, isAfter } from "date-fns";
import { addMinutes, isAfter, isBefore } from "date-fns";
import { Input } from "../form/input/input";
import { InputTags } from "../form/inputTags/inputTags";
import { Textarea } from "../form/textarea/textarea";
Expand Down Expand Up @@ -173,7 +173,7 @@ export const MeetingUpdateModal = forwardRef<
valueAsDate: true,
required: "End date is required.",
validate: (value) =>
isAfter(new Date(value), new Date(startDate)) ||
isBefore(new Date(startDate), new Date(value)) ||
"End date must be after start date.",
})}
/>
Expand Down

0 comments on commit 797b61c

Please sign in to comment.