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 for Mobile Google Calendar Odd/Even Week Imports #3684

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

onx001
Copy link

@onx001 onx001 commented Mar 24, 2024

Added interval checking for numeric week calculations as Google Calendar imports on mobile do not handle exclusions well.

Also fixed additional tutorials for odd/even weeks being added after Week 11/13.

Context

#3679
.ics iCal exports have weird handling issues with even/odd weeks, namely extra lessons after the intended one and a lack of proper exclusion handling for mobile Google Calendar users.

Implementation

A simple interval calculator is implemented for the calculateNumericWeek function, and the count and interval fields are passed to the ics generator where previously they were missing and filled through exclusions.

Other Information

Current handling of edge case intervals that do not follow the regular pattern or that skip intervals might still have the bug for extra lessons. Needs further investigation.

Added interval checking for numeric week calculations as Google Calendar imports on mobile do not handle exclusions well.

Also fixed additional tutorials for odd/even weeks being added after Week 11/13.
Copy link

vercel bot commented Mar 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nusmods-export ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 0:09am
nusmods-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 0:09am

Copy link

vercel bot commented Mar 24, 2024

@onx001 is attempting to deploy a commit to a Personal Account owned by @nusmodifications on Vercel.

@nusmodifications first needs to authorize it.

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.71%. Comparing base (7334b07) to head (1576dd8).

❗ Current head 1576dd8 differs from pull request most recent head ce67073. Consider uploading reports for the commit ce67073 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3684      +/-   ##
==========================================
+ Coverage   53.62%   53.71%   +0.09%     
==========================================
  Files         272      272              
  Lines        5979     5991      +12     
  Branches     1428     1433       +5     
==========================================
+ Hits         3206     3218      +12     
  Misses       2773     2773              

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

@@ -96,7 +96,7 @@
"icalendar": "0.7.1",
"identity-obj-proxy": "3.0.0",
"jest": "29.6.2",
"jest-environment-jsdom": "^29.5.0",
"jest-environment-jsdom": "^29.7.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'll get to reviewing and testing the code by this Wednesday. In the meantime, can I check if bumping the dependencies here (and creating a package.json for the monorepo) is required for the change to work? Otherwise, could you help remove those diffs (package.json, website/package.json, and website/src/utils/yarn.lock from this PR? Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, done! The dependencies were not required to be updated. I have not worked with yarn before so was a little unfamiliar with the process. Thank you for your help!

Copy link
Member

@kokrui kokrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@kokrui kokrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold on, my bad -- it looks like this new PR is creating events beyond the end date of the semester. @onx001 if you look export from this PR's deployment (https://nusmods-website-zrekiv0gl-mods-bot.vercel.app/timetable/sem-1) does the calendar work for you?

@ravern
Copy link
Member

ravern commented Apr 17, 2024

Hi, just tested out this PR as well, and there seems to be another bug: events on odd weeks only show up before recess week, while events on event weeks only show up after recess week.

Here's the timetable I used and I've also attached the exact .ics file I used.

https://nusmods-website-zrekiv0gl-mods-bot.vercel.app/timetable/sem-2/share?ME2115=LAB:2G1,TUT:2G,LEC:1&ME2121=LAB:2G3,TUT:2N,LEC:1

nusmods_calendar.ics.zip

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.

3 participants