Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion frontend/app/(planner)/[planner]/planner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function PlannerPage({umbrellaID}: PlannerPageProps) {
)}

<section className="mt-5">
<EventCalendar events={events} initialView={"agenda"}/>
<EventCalendar events={events} initialView={"week"}/>
</section>
</TooltipProvider>
);
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/event-calendar/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export const WeekCellsHeight = 72
export const AgendaDaysToShow = 30

// Start and end hours for the week and day views
export const StartHour = 0
export const StartHour = 8
export const EndHour = 24

// Default start and end times
export const DefaultStartHour = 9 // 9 AM
export const DefaultEndHour = 10 // 10 AM

// Max Number of parallel Events in a timeslot for Weekly View
export const MaxParallelWeeklyEvents = 4
6 changes: 3 additions & 3 deletions frontend/components/event-calendar/week-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
WeekCellsHeight,
} from "@/components/event-calendar"
import type { Event } from "@/lib/gql/generated/graphql"
import {EndHour, StartHour} from "@/components/event-calendar/constants"
import {EndHour, StartHour, MaxParallelWeeklyEvents} from "@/components/event-calendar/constants"

interface WeekViewProps {
currentDate: Date
Expand Down Expand Up @@ -185,8 +185,8 @@ export function WeekView({
currentColumn.push({event, end: adjustedEnd})

// Calculate width and left position based on number of columns
const width = columnIndex === 0 ? 1 : 1 - (columnIndex * 0.1)
const left = columnIndex === 0 ? 0 : columnIndex * 0.1
const left = columnIndex === 0 ? 0 : (columnIndex) / (MaxParallelWeeklyEvents)
const width = columnIndex === 0 ? 1 : 1-left

positionedEvents.push({
event,
Expand Down
Loading