Skip to content

Add calendar endpoint - #23

Merged
Oscariremma merged 5 commits into
gudchalmers:mainfrom
olillin:main
Dec 29, 2025
Merged

Add calendar endpoint#23
Oscariremma merged 5 commits into
gudchalmers:mainfrom
olillin:main

Conversation

@olillin

@olillin olillin commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

This pull request adds GET /cal.ics which generates a calendar file containing the study weeks in a time period around the current date. It also adds a dependency, iamcal, which is used to generate the calendar. The library is maintained by me.

The time period defaults to 8 weeks before and after the current date. The time period can be customized by the before and after query parameters which can be between 0 and a maximum value defined by the environment variables MAX_BEFORE and MAX_AFTER respectively (both default to 20 weeks).

The events are full-day events on every Monday with the study week as the summary (see screenshot below).

image

@Oscariremma

Copy link
Copy Markdown
Member

Looks good!
One thing we might want to do is to add a link to the ical endpoint from the main page so that it is discoverable (and also update the README).
But if that is not something you feel like adding we can probably add it later.

@olillin

olillin commented Dec 6, 2025

Copy link
Copy Markdown
Contributor Author

One thing we might want to do is to add a link to the ical endpoint from the main page so that it is discoverable (and also update the README). But if that is not something you feel like adding we can probably add it later.

Unfortunately, I do not have time to implement this myself at the moment. But if you want to do it yourself you could look at when I did this for nollk.it: cthit/nollk.it#72

@olillin

olillin commented Dec 28, 2025

Copy link
Copy Markdown
Contributor Author

I have started working on a panel to subscribe to the calendar now, not quite happy with the design though so I will keep working on it some more.

image

@olillin

olillin commented Dec 28, 2025

Copy link
Copy Markdown
Contributor Author

Looks like this now, bigger text definitely fits better with the large week title.

image image

@olillin

olillin commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

@Oscariremma I found some spare time and have implemented the requested changes. Let me know if there is anything that needs changing!

I also made the decision to break out the CSS and JavaScript into separate files because there was suddenly a lot more of it and it was easier to develop this way (and likely to maintain)

@Oscariremma Oscariremma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great and thanks for the contribution!

@Oscariremma
Oscariremma merged commit 4627450 into gudchalmers:main Dec 29, 2025
1 check passed
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.

2 participants