Skip to content

feat: add release calendar export #415

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

Merged
merged 4 commits into from
Apr 7, 2025

Conversation

ajanvier
Copy link
Contributor

@ajanvier ajanvier commented Apr 5, 2025

Export the release calendar through an iCal file that can be downloaded from the calendar page or accessed through a link also displayed on the calendar page (authenticated using the user's token).

Fixes #375

@ajanvier ajanvier changed the title Add release calendar export feat: add release calendar export Apr 5, 2025
Copy link

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.59%. Comparing base (86803b1) to head (000398a).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #415   +/-   ##
=======================================
  Coverage   86.59%   86.59%           
=======================================
  Files          56       56           
  Lines        4730     4730           
=======================================
  Hits         4096     4096           
  Misses        634      634           

☔ View full report in Codecov by Sentry.
📢 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.

@FuzzyGrim FuzzyGrim merged commit 6e7a195 into FuzzyGrim:dev Apr 7, 2025
8 checks passed
@FuzzyGrim
Copy link
Owner

Thanks!

@FuzzyGrim
Copy link
Owner

Would there be any problem in changing from all day events to time specific events with time zone information? I can implement the change, but I would like to know if there would be any possible problems that I haven't thought of.

The current implementation creates day-long events using only the date component of release timestamps. This causes timezone discrepancies for users in different timezones, as UTC release times don't properly convert to the user's local date.

  • Problem scenario example:
    • A TV episode releases at 2025-04-13 01:00 UTC
    • For a user in GMT-3 (Brazil), this is actually 2025-04-12 22:00 local time
    • Current implementation creates an all-day event on 2025-04-13
    • User misses the release because they're looking at April 13 when the show actually releases on their local April 12
# Current implementation (creates all-day events)
cal_event.add("dtstart", release.datetime.date())
cal_event.add("dtend", release.datetime.date() + timedelta(days=1))

# Proposed implementation (creates time-specific events with timezone)
local_dt = timezone.localtime(release.datetime)
cal_event.add("dtstart", local_dt)
cal_event.add("dtend", local_dt)

@ajanvier
Copy link
Contributor Author

ajanvier commented Apr 13, 2025

If you want to use time-specific events, as the icalendar library extracts the timezone info from tz-aware datetime (see docs), I would go with something like:

dt_tz_aware = release.datetime.replace(tzinfo=timezone.utc)
cal_event.add("dtstart", dt_tz_aware)
cal_event.add("dtend", dt_tz_aware)

The calendar client will see that the time is defined as UTC and should adapt it depending on the localtime or user settings.
I haven't tried it though so please don't take my word for granted.

@ajanvier ajanvier deleted the feat/export-release-calendar branch May 1, 2025 11:14
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.

[Feature Request] Export the Release Calendar to iCalendar format
2 participants