5 ms·
Were those recurring meetings or one-offs? Part of a product I'm working on now is being able to schedule repeating tasks every day, every month, etc. Which me
by DCoder 15y ago
Were those recurring meetings or one-offs?
Part of a product I'm working on now is being able to schedule repeating tasks every day, every month, etc. Which means that "07:30 every Friday" has to happen at 07:30 in the author's timezone, whether or not DST is active. To my knowledge Javascript can only tell you the timezone offset from UTC for a given date/time. You can determine the DST-less offset that way, but there are multiple timezones sharing the same offset (e.g. PHP has 63 separate timezone records for Europe alone) and then simply matching them by offsets doesn't work ideally, you need the user to make a choice.
- bhousel 15y agoThey were one-off meetings, but I think we could have done recurring meetings with the data that we were storing. I see what you mean about the different timezones in PHP - these are based off the Olsen timezone database. I do think the best way to make users happy is to let them pick their default timezone on a personalization screen, and display it (but let them change it) along with each event that they create. This Javascript code below can get you most of the way there, but it does come with the caveat that "Not all Olson tz keys are given by this script. If there are many timezones with UTC+6 but none of them use daylight savings, this script simply returns ONE of the timezone keys representing this type of timezones." https://bitbucket.org/pellepim/jstimezonedetect/wiki/Home https://bitbucket.org/pellepim/jstimezonedetect/wiki/Home