Skip to content

Commit

Permalink
remove hack for tz conversion;
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jan 20, 2025
1 parent c898bf1 commit 240474d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/pages/PublicAppointments/Success.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { format } from "date-fns";
import dayjs from "dayjs";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";

Expand Down Expand Up @@ -42,16 +41,13 @@ export function AppointmentSuccess(props: { appointmentId: string }) {
(appointment) => appointment.id === appointmentId,
);

if (isLoading) {
if (isLoading || !appointmentData) {
return <Loading />;
}

const appointmentTime = dayjs(appointmentData?.token_slot.start_datetime)
.add(-5, "hours")
.add(-30, "minutes")
.toISOString();
const appointmentDate = format(new Date(appointmentTime), "do MMMM");
const appointmentTimeSlot = format(new Date(appointmentTime), "hh:mm a");
const appointmentTime = appointmentData.token_slot.start_datetime;
const appointmentDate = format(appointmentTime, "do MMMM");
const appointmentTimeSlot = format(appointmentTime, "hh:mm a");

return (
<div className="mx-auto p-2 max-w-3xl">
Expand Down

0 comments on commit 240474d

Please sign in to comment.