add2cal / add-to-calendar-button

Reliably create beautiful Add to Calendar Buttons, where people can add events to their calendars. Without the hustle and unsupported cases.
https://add-to-calendar-button.com
Other
1.36k stars 114 forks source link

feature request: when buttonStyle=date, option to display date/time in browser local timezone #543

Closed pleasantone closed 9 months ago

pleasantone commented 9 months ago

I've got two choices, (a) send date to add-to-calendar in a local timezone, unfortunately atcb does not support the timezones that golang's format puts out which are time-zone abbreviations (i.e. there is no easy way for me to convert "PST" and "PDT" to "America/Los_Angeles" with every timezone out there...) or (b) send the date to atcb as UTC.

If I do (b), it is displayed in UTC in the browser, which can be confusing, especially if the date is different between local and UTC.

It would be nice if we could display the date/times using the browser local timezone.

Failing that, it would be lovely if you could handle full ISO dates with timezone offsets so I can send to atcb 2006-01-02T15:04:05Z0700 then at least the event would be displayed in the local timezone. I think you unofficially support a subset (no seconds) but just UTC/Zulu time?

jekuer commented 9 months ago

Not exactly sure what you are up for, but: 1) PSD is not a time zone and therefore is also not recognized by most calendars. We are using the IANA tz database, which can be seen as the gold standard when it comes to time zone management. 2) as described at https://add-to-calendar-button.com/configuration#timezone, you can use currentBrowser to always use the time zone of the user's browser. However, this might not be what you want (see docs). 3) providing an option to use offset at the time input is problematic, as it can match multiple time zones. So, a worse solution which needs to be maintained.

Hopefully, the above works for you. I will close the issue for now, as there is no bug or misbehavior as far as I see.

pleasantone commented 9 months ago

Let me simplify the case. There are two time zones, the time zone the event was created in, and the timezone displayed to the user.

Imagine we enter all events in UTC, the default. I am asking you for the ability to display the event in browser timezone.

All I am asking for really is that. Forget PST/PDT and offsets.

jekuer commented 9 months ago

I see. For the date button only. We have this via some magic keywords at the location. And when the location is a url. Assumption here: This only makes sense for online events or global gatherings. Otherwise, it confuses the user - especially if they live near different time zones. Imagine you live in LA and there is an event in Arizona. If we would show LA time, the person would be late in Arizona.

pleasantone commented 9 months ago

Thank you for having considered it.