Skip to content

Display relevant weeks on exam timetable#4418

Open
not-a-scam wants to merge 9 commits into
nusmodifications:masterfrom
not-a-scam:feat/full-week-exam
Open

Display relevant weeks on exam timetable#4418
not-a-scam wants to merge 9 commits into
nusmodifications:masterfrom
not-a-scam:feat/full-week-exam

Conversation

@not-a-scam

Copy link
Copy Markdown

Context

Initially just created to close #1717

Additionally updated exam timetable to only display the week when exams to be taken are happening. Previously, the first week will always be displayed even if there are no exams to be taken.
timetable with extra weeks

Implementation

Full Week Display

timetable with full week displayed
  • Check if there is a Saturday exam and display full week if there is
  • Change cell width to be equal across days with the addition of Sunday

Display relevant weeks

  1. Filter out examinable mods from visible mods
  2. Map visible and examinable mods to their exam dates
  3. Reduce by comparison to get first and last exam dates
  4. Normalise result to always be a Monday
  5. Calculate number of weeks for display
timetable with only relevant weeks

Other Information

First PR here! Feedback is appreciated!

  • Created it so that if there are no exams, the getExamCalendar would return the current date as the first date instead for simplicity, but not sure if there are better return value? Considered using the first day of exams from the academic calendar but I thought the additional call would be unnecessary since the value isn't used.

  • I think the addition of Sunday looks fine on mobile. Seemed to be a concern in Exams on Saturday should show full week #1717 but included a gif for reference

mobile view of timetable

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@not-a-scam is attempting to deploy a commit to the modsbot's projects Team on Vercel.

A member of the Team first needs to authorize it.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.44%. Comparing base (988c6fd) to head (24cf382).
⚠️ Report is 244 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4418      +/-   ##
==========================================
+ Coverage   54.52%   56.44%   +1.91%     
==========================================
  Files         274      317      +43     
  Lines        6076     6963     +887     
  Branches     1455     1683     +228     
==========================================
+ Hits         3313     3930     +617     
- Misses       2763     3033     +270     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exams on Saturday should show full week

1 participant