Skip to content

Commit

Permalink
small adjustment to time of the new endDate
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKoko committed Jan 15, 2025
1 parent 615a939 commit 7935a70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/booking/form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useMemo, useState } from "react";
import { useLoaderData, useNavigation } from "@remix-run/react";
import { endOfDay } from "date-fns";
import { useAtom } from "jotai";
import { DateTime } from "luxon";
import { useZorm } from "react-zorm";
Expand Down Expand Up @@ -363,8 +362,9 @@ export function BookingForm({
*/
const newStartDate = new Date(event.target.value);
if (endDate && newStartDate > new Date(endDate)) {
const now = new Date();
const newEndDate = dateForDateTimeInputValue(
endOfDay(newStartDate)
new Date(now.setHours(18, 0, 0))
);
setEndDate(
newEndDate.substring(0, newEndDate.length - 3)
Expand Down

0 comments on commit 7935a70

Please sign in to comment.