Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix events list #54

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
</>
);
);
}
Loading