mlool / workday-calendar-extension

MIT License
60 stars 24 forks source link

Implement Exporting via .ics (GCal, Apple etc) #80

Closed jaskirat-gill closed 3 months ago

jaskirat-gill commented 3 months ago

closes #75

Implements functionality to export to an .ics file which can be used for Google Calendar, Apple Calendar etc

Downloads a file for every non empty worklist the user has named 'worklist_X.ics'

Ended up not using any API or package and just manually formatting section data into a string that adheres to the ics specification and can be interpreted as a calendar

One thing to note is that we have the same issue here as getting terms from section details where it only works for this upcoming year. In the future will probably need a better system to support every year

The reason this is tricky is that we only have the term number or name, the exact start and end dates that correspond to that term have to be found on the UBC calendar. Right now I just map the terms we support to their corresponding start/end dates but that will not work when we start to support more terms

image image image

StashC commented 3 months ago

@jaskirat-gill Can you please merge the latest develop to your branch?

jaskirat-gill commented 3 months ago

@StashC Done! I think i resolved everything correctly to work with the refactor of settings, everything works when I tested but let me know if there are any issues

StashC commented 3 months ago

@jaskirat-gill Hi, I think the CSS for the buttons is broken after merging develop: image

Can we make the new export calender button on a seperate line, and have space between the Export and Import buttons?

jaskirat-gill commented 3 months ago

@StashC Fixed! New UI Should look like image

StashC commented 3 months ago

Hi, I think I found a bug. I added CPSC 313 to my schedule, and it doesnt show up on the first week, but shows up on the second week. In Workday the start date says September 3rd, so I believe there should be a class on the 4th and 6th aswell:

https://github.com/mlool/workday-calendar-extension/assets/89222842/399bca53-45e8-4fdd-ae73-3b2500eb9411

jaskirat-gill commented 3 months ago

@StashC Fixed! Was an error with how start days are being calculated. Since most terms start on a Tuesday it threw off the offsets for first course meeting time when a course meets on mondays. Found a simpler way to do it and it seems to be working much better image

mlool commented 3 months ago

Is this PR good to go?

jaskirat-gill commented 3 months ago

Good to go on my end. Don't know if anyone has reviewed after i fixed the intial issues