Skip to content

Commit

Permalink
fix filter event in app logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Sijin Soon committed Oct 31, 2023
1 parent afa43ff commit 5966521
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ const App: React.FC = () => {
Math.min(
...selectedCourses.map((course) => course.earliestStartTime),
...Object.entries(createdEvents)
.filter(([_, eventPeriod]) => eventPeriod.time && eventPeriod.type === 'event')
.filter(([_, eventPeriod]) => eventPeriod.type === 'event')
.map(([_, eventPeriod]) => Math.floor(eventPeriod.time!.start)),
getDefaultStartTime(isConvertToLocalTimezone),
prev,
Expand All @@ -444,7 +444,7 @@ const App: React.FC = () => {
Math.max(
...selectedCourses.map((course) => course.latestFinishTime),
...Object.entries(createdEvents)
.filter(([_, eventPeriod]) => eventPeriod.time && eventPeriod.type === 'event')
.filter(([_, eventPeriod]) => eventPeriod.type === 'event')
.map(([_, eventPeriod]) => Math.ceil(eventPeriod.time!.end)),
getDefaultEndTime(isConvertToLocalTimezone),
prev,
Expand All @@ -456,7 +456,9 @@ const App: React.FC = () => {
0,
Math.max(
getLatestDotW(selectedCourses),
...Object.entries(createdEvents).filter(([_, eventPeriod]) => eventPeriod.time && eventPeriod.type === 'event').map(([_, eventPeriod]) => eventPeriod.time!.day),
...Object.entries(createdEvents)
.filter(([_, eventPeriod]) => eventPeriod.type === 'event')
.map(([_, eventPeriod]) => eventPeriod.time!.day),
days.length, // Saturday and/or Sunday columns persist until the next reload even if they aren't needed anymore
5, // default
),
Expand Down

0 comments on commit 5966521

Please sign in to comment.