Skip to content

Commit

Permalink
Merge pull request #849 from Shelf-nu/improvement-default-time-of-boo…
Browse files Browse the repository at this point in the history
…king

Improvement: default time of booking is automatically set
  • Loading branch information
DonKoko authored Mar 18, 2024
2 parents 099448d + d15892f commit bf823b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
14 changes: 3 additions & 11 deletions app/routes/_layout+/bookings.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const handle = {
export const links: LinksFunction = () => [{ rel: "stylesheet", href: styles }];
export default function NewBooking() {
const { booking, teamMembers } = useLoaderData<typeof loader>();

const now = new Date();
return (
<div>
<header className="mb-5">
Expand All @@ -203,16 +203,8 @@ export default function NewBooking() {
<BookingForm
id={booking.id}
name={booking.name}
startDate={
booking.from
? dateForDateTimeInputValue(new Date(booking.from))
: undefined
}
endDate={
booking.to
? dateForDateTimeInputValue(new Date(booking.to))
: undefined
}
startDate={dateForDateTimeInputValue(new Date(now.setHours(8, 0, 0)))}
endDate={dateForDateTimeInputValue(new Date(now.setHours(18, 0, 0)))}
custodianUserId={
booking.custodianUserId ||
teamMembers.find(
Expand Down
2 changes: 1 addition & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { serve } from "@hono/node-server";
import { serveStatic } from "@hono/node-server/serve-static";
import * as serverBuild from "@remix-run/dev/server-build";
import type { AppLoadContext, ServerBuild } from "@remix-run/node";
import { createCookieSessionStorage, installGlobals } from "@remix-run/node";
import { createCookieSessionStorage } from "@remix-run/node";
import { broadcastDevReady } from "@remix-run/server-runtime";
import { Hono } from "hono";
import { remix } from "remix-hono/handler";
Expand Down
3 changes: 0 additions & 3 deletions test/setup-test-env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { installGlobals } from "@remix-run/node";
import "@testing-library/jest-dom/extend-expect";
import { server } from "mocks";

Expand All @@ -13,8 +12,6 @@ if (typeof window !== "undefined") {
window.happyDOM.settings.enableFileSystemHttpRequests = true;
}

// installGlobals();

beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
afterAll(() => server.close());
afterEach(() => server.resetHandlers());

0 comments on commit bf823b0

Please sign in to comment.