sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Automatic timezone selection #195

Open JulianGro opened 1 year ago

JulianGro commented 1 year ago

For international event calendars, it is almost a requirement for the calendar to automatically choose the correct timezone for the user.

There doesn't seem to be any open-source web calendar that does this.

Apparently you can only get this via JavaScript or GeoIP.

sproctor commented 1 year ago

Even ignoring detection, it's a bit complicated. I can imagine circumstances where you'd want to use the timezone from the calendar in most circumstances. I can imagine some calendars don't themselves have a specific location and so would prefer the user's timezone.

Tangent aside, using JavaScript in this instance is quite complicated because it would need to be specified before building the page. This is simpler on pages using an API, but it's not practical here. When I'm done with v3, using javascript to suggest a setting update could be interesting.

I'm not sure how accurate GeoIP is. I'm not interested in doing the work to implement that.

My thought is that we should have a setting for the calendar whether to prefer the calendar timezone or the user's timezone. And for the user, nag them to change their timezone if JS finds a different one than there setting and have an easy option to stop the nagging.

I've been thinking about re-writing the front-end with React or some such and writing an API. This would allow using javascript to set the timezone. I just got done porting it to a template system and I need to get a final working version of that, so this probably won't be happening too soon.