Skip to content

Commit

Permalink
Fix events list
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunkomath committed Jan 9, 2025
1 parent 981b524 commit 4d3611a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/(dashboard)/[tenant]/projects/[projectId]/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import {
desc,
eq,
gt,
gte,
isNotNull,
lt,
lte,
or,
} from "drizzle-orm";
import { RssIcon } from "lucide-react";
Expand Down Expand Up @@ -47,7 +45,7 @@ export default async function EventDetails(props: Props) {
const timezone = await getTimezone();

// Convert the selected date to the user's timezone and then to UTC for the database
const selectedDate = on ? dayjs.tz(on, timezone).utc() : dayjs().utc();
const selectedDate = dayjs(new Date(on));
const dayCommentId = `${projectId}${selectedDate.year()}${selectedDate.month()}${selectedDate.date()}`;

const startOfDay = selectedDate.startOf("day").toDate();
Expand Down Expand Up @@ -91,7 +89,7 @@ export default async function EventDetails(props: Props) {
})
.execute();

const calendarSubscriptionUrl = `/api/calendar/${ownerId}/${projectId}/calendar.ics`;
const calendarSubscriptionUrl = `/api/calendar/${ownerId}/${projectId}/calendar.ics?userId=${userId}`;

return (
<>
Expand Down Expand Up @@ -144,5 +142,5 @@ export default async function EventDetails(props: Props) {
/>
</div>
</>
);
);
}

0 comments on commit 4d3611a

Please sign in to comment.