Skip to content

Dynamic Calendar Options for go-calendar Project #5

Open
@selfish

Description

@selfish

Option 2 is an awesome suggestion and was my original path. [...] So although its absolutely the right path to take, I'm not sure its perhaps the best one in this scenario.

Originally posted by @othyn in #4 (comment)

--

Hey @othyn,

I've been thinking about your comment on Option 2 in the go-calendar project, and I decided to give the dynamic option a try. I hope it's okay that I decided to split the discussion to a new issue.

If your domain is on Cloudflare, it would be super easy to set up with a Cloudflare Worker (which is free). I made a proof of concept and put it under my personal domain. It's not fully tested, so there might be some errors, but here are the links for reference:

Description URL
Main calendar (defaults to UTC) https://nit.ai/gocal.ics
Timezone-specific with timezone param https://nit.ai/gocal.ics?timezone=America/Port-au-Prince
List of valid timezones shows if you type in a wrong one https://nit.ai/gocal.ics?timezone=foo
Exclude events (blacklist style) https://nit.ai/gocal.ics?exclude=community_day
Exclude multiple events https://nit.ai/gocal.ics?exclude=community_day&exclude=elite_raids
List of valid categories shows if you type in a wrong one https://nit.ai/gocal.ics?exclude=foo
Include events (whitelist style) https://nit.ai/gocal.ics?include=pokemon_spotlight_hour
Timezone and filter combined https://nit.ai/gocal.ics?timezone=America/Port-au-Prince&exclude=season&exclude=research
Special category all_day (see notes) https://nit.ai/gocal.ics?exclude=all_day

Just a few notes:

  1. As I mentioned, this isn't fully tested, so there might be some issues.
  2. 'Exclude' and 'include' parameters can't be used together (not sure about the logic if both are used).
  3. I added a special category for 'exclude/include' called all_day, which filters all-day events across categories.

I've actually been using it with Google Calendar for about a week now with no issues.

I'd be happy to contribute the full code for this! Let me know the best way to do that, and if you need any help setting it up under your own domain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions