seriouslysean / monster-hunter-now-events

A tool that auto-generates calendar events for Monster Hunter Now by scraping web news articles, processing them with AI, and creating a convenient calendar subscription.
https://seriouslysean.github.io/monster-hunter-now-events/
MIT License
8 stars 9 forks source link

[Bug]: Google Calendar Infers Timezone for Floating Events #20

Open seriouslysean opened 9 months ago

seriouslysean commented 9 months ago

Bug Description

Event from the ICS file

DTSTART:20231009T090000
DTEND:20231015T160000
SUMMARY:MHN: Rathian & Pink Rathian Special Appearance
DESCRIPTION:Rathian and Pink Rathian will appear more frequently than usual
 , especially during the weekend. Pink Rathian will appear in low numbers
  in Forest Habitats for all hunters HR11 and above. While appearance rat
 es are boosted, Rathian will appear more frequently than usual and Pink 
 Rathian will also be easier to find.
END:VEVENT

Not the lazy of a Z at the end of the datetime (this implies floating time). When utilizing floating times, Google Calendar infers a timezone for the event (which seems to be UTC).

image

This doesn't work for MHN events as they're timezone agnostic. If the event is 1-4pm, it's 1-4pm in every single timezone which means a fixed point in time isn't possible.

At this point the only solution I can think of is to have timezone specific subscriptions, but that only works if you never leave your timezone. Retaining the floating time would be much better.

Expected Behavior

Google Calendar should show events at the proper time, similar to how Apple Calendar does.

image

Steps to Reproduce (Optional)

  1. Subscribe to the calendar feed via Google Calendar
  2. Verify the MHN event times are incorrect
seriouslysean commented 8 months ago

The more I look in to this, the less I think a timezone will fix things. In order to have an event that starts at the same time regardless of timezone, I'd either need to use floating times (which I do already) or create a separate event per timezone. Taking Eastern, Central and Pacific time, I'd need 3 different calendar feeds with events just for that timezone, or 3 different events:

BEGIN:VEVENT
UID:1@example.com
DTSTART;TZID=America/New_York:20230101T130000
DTEND;TZID=America/New_York:20230101T160000
SUMMARY:Event for Eastern Time
END:VEVENT

BEGIN:VEVENT
UID:2@example.com
DTSTART;TZID=America/Chicago:20230101T130000
DTEND;TZID=America/Chicago:20230101T160000
SUMMARY:Event for Central Time
END:VEVENT

BEGIN:VEVENT
UID:3@example.com
DTSTART;TZID=America/Los_Angeles:20230101T130000
DTEND;TZID=America/Los_Angeles:20230101T160000
SUMMARY:Event for Pacific Time
END:VEVENT

Which isn't really a solve at all.

seriouslysean commented 8 months ago

Short of creating a web server or some sort to infer user location and automatically assign the timezone, then send back a user specific file, I don't see this working out.

seriouslysean commented 8 months ago

To humor myself, I asked ChatGPT what it thought about the issue:

Prompt:

Apple Calendar on iOS works with floating timezones, but microsoft outlook and google calendar appear not to.

The issue is that the events I'm tracking occur for a fixed duration at the same time regardless of timezone. So if the event is 1-4pm, it's 1-4pm anywhere you are in the world.

This doesn't seem to work with fixed times. If I was to use GMT and set the event to 1-4pm, each consumer of the ics file would alter the time and date based on their own particular offsets. Do you have any suggestions on how to handle that issue?

Answer

The situation you're describing is a unique one. Typically, events have a fixed time in a specific timezone, and users in different timezones see the event's local equivalent. But you want the event to appear at the exact same local time regardless of the user's timezone.

Floating times in iCalendar format are indeed intended for this purpose, but as you've noticed, not every calendar software handles them correctly.

Here are a few potential solutions to tackle the problem:

Create Multiple ICS Files: You could generate separate ICS files for each major timezone you're targeting. This is tedious and doesn't cover every individual case, but for a broad audience, targeting the major timezones (PST, CST, EST, etc.) might be enough. Users would need to pick or be directed to the appropriate ICS file based on their location.

Use an Intermediary Service: Instead of directly offering an ICS file, you could have users sign up for calendar updates on a website. Once they choose their timezone, your backend could generate personalized calendar events for them. This is a more interactive solution and requires a bit of infrastructure but offers a personalized touch.

Educate & Instruct: Since there is no perfect technical solution for this because of varying client behavior, you could use the DESCRIPTION or LOCATION field of the event to remind users to adjust the time as necessary for their timezone. E.g., "This event is set for 1-4pm YOUR LOCAL TIME. Please adjust if it appears differently."

Duplicate Events: This is a bit of a hack, but you could add the same event multiple times to the ICS file, once for each major timezone. This will cause the event to appear correctly for most users, but users will also see duplicates of the event at other times of the day. This is not an ideal solution, but it's an option.

Feedback to Calendar App Developers: Given the nature of this problem and the inconsistencies across calendar apps, it could be valuable to submit feedback to major calendar software developers like Google and Microsoft. It's a long shot, but if enough people have this use case and raise the issue, it could lead to improved handling of floating times in future software versions.

The core of the issue is the lack of consistent behavior across calendar clients, which makes it challenging to find a one-size-fits-all solution. You'll need to consider the trade-offs of each approach and decide which one aligns best with your user base and project goals.

seriouslysean commented 8 months ago

Outlook actually shows the events correctly, also.

image