Coder Social home page Coder Social logo

Timezone support about cal.com HOT 31 CLOSED

calcom avatar calcom commented on August 25, 2024 11
Timezone support

from cal.com.

Comments (31)

50bbx avatar 50bbx commented on August 25, 2024 12

Basic time zone support PR: https://github.com/calendso/calendso/pull/28

from cal.com.

50bbx avatar 50bbx commented on August 25, 2024 7

Hey guys,

I implemented this feature, both for the owner of the calendar and for the user choosing a slot.

No dropdown yet (just getting default timezone), but I will create a PR tomorrow.

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024 4

I would place the time zone drop down here, as people may miss it on the first page:

image

from cal.com.

surjithctly avatar surjithctly commented on August 25, 2024 2

@abrambailey Usually it's based on Geo-location along with an option to modify it.

I prefer something like this:

image

from cal.com.

surjithctly avatar surjithctly commented on August 25, 2024 1

Perfect.

image

from cal.com.

Soneji avatar Soneji commented on August 25, 2024 1

Hi all, I just thought I'd drop by and mention a test case that often causes a problem with timezones, and has also caused a problem for Easy Appointments

The test case is for countries/timezones that change for daylight saving time. It can often result in entire calendars being out of sync by 1 hour and also possibly one week with correct timings, and the week after daylight saving time starts being 1 hour out of sync

Thanks in advance

from cal.com.

emrysal avatar emrysal commented on August 25, 2024 1

In reaction to that @50bbx; I opened an issue on ndom91/react-timezone-select#25 - let's see what comes back.

from cal.com.

50bbx avatar 50bbx commented on August 25, 2024 1

Thanks @emrysal it works!

See https://github.com/calendso/calendso/pull/163

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024 1

Just a small issue here. The first image comes from my email ... The second comes from the icon to add to google calendar in the confirmation page. Not sure which one is wrong, but they can't both be right:

image

image

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024 1

So the emailed invite seems fine. There is a weird bug in the thank you page, the first time I click on the google icon, I get the wrong time. If I click back and try again, I get the correct time. I tried it twice.

image

image

image

image

from cal.com.

jimafisk avatar jimafisk commented on August 25, 2024 1

Can confirm I'm seeing the same behavior as @abrambailey. Behind the scenes the meeting gets added to the correct timeslot, but if you click "G" icon in the "Add to your calendar" section of the booking confirmation page, it adds it in the wrong timezone.

Screenshot of confirmation page

confirm

Screenshot of the calendar event with incorrect time

wrong_time

I'm curious about the intention of this "add to calendar" feature if the event is already getting added to the calendar of the person based on their email address. Is it so the person requesting the appointment can add it to another calendar?

from cal.com.

surjithctly avatar surjithctly commented on August 25, 2024

Agreed. without showing the Timezone on the client side, it will be really confusing. Great if the times are automatically converted to user timezone and mention it visibly.

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024

Yeah, this won't work for me either without it.

from cal.com.

emrysal avatar emrysal commented on August 25, 2024

#8

Currently this translates it without telling the user the person they are booking is in a different timezone, so this would be a future addition. Current behaviour shows the bookable slots as it is known by the user, so for example a meeting slot booked for 3pm agent time UTC+0600 would show up as a 10am slot for the booker in the UK.

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024

Interesting, how do you know the user's TZ? What if they are traveling?

from cal.com.

Nevon avatar Nevon commented on August 25, 2024

You can get the offset between the current user and UTC by doing new Date().getTimezoneOffset(). I'm in CET, which is currently two hours ahead of UTC, which means that it returns -120.

from cal.com.

baileypumfleet avatar baileypumfleet commented on August 25, 2024

Okay, so we have the basic timezone support PR merged in and everything, so let's discuss next steps. I know we would still need to add the timezone label or dropdown on the booking page, for instance.

from cal.com.

surjithctly avatar surjithctly commented on August 25, 2024

when will this available? I don't see it in the live demo.

from cal.com.

baileypumfleet avatar baileypumfleet commented on August 25, 2024

Just to update you all, as part of this, I've added a new field on the booking screen's left column which shows the guessed timezone. If you click it, there's a dropdown to switch between 12 and 24 hours, but that's where the timezone selection should also go.

from cal.com.

50bbx avatar 50bbx commented on August 25, 2024

@baileypumfleet Did you make a pull request?

I have the code ready locally to switch between timezones

from cal.com.

baileypumfleet avatar baileypumfleet commented on August 25, 2024

@50bbx No, I directly committed it

from cal.com.

baileypumfleet avatar baileypumfleet commented on August 25, 2024

@50bbx Is your code for switching between the timezones ready for a PR? Super excited to get this added in :)

from cal.com.

50bbx avatar 50bbx commented on August 25, 2024

I saw that there were some changes on the timezone component selector, here We need to address those and understand how we are going to manage the timezone selector.

I need to add that component to the book an appointment page.

When we settle things down on that side I will extract the timezone selector in a separate file and make the PR.

from cal.com.

harad avatar harad commented on August 25, 2024

Hi all, I just thought I'd drop by and mention a test case that often causes a problem with timezones, and has also caused a problem for Easy Appointments

The test case is for countries/timezones that change for daylight saving time. It can often result in entire calendars being out of sync by 1 hour and also possibly one week with correct timings, and the week after daylight saving time starts being 1 hour out of sync

We could go think about using Coordinated Universal Time, like Google Calendar does, to not run into the issue of daylight saving.

https://en.wikipedia.org/wiki/Coordinated_Universal_Time

from cal.com.

emrysal avatar emrysal commented on August 25, 2024

Hey @50bbx - This was a small amend not to change any logic, but whilst condensing the options I was thinking that it would make sense to extract the timezone logic into a seperate component as well, to implement extra features. For example so we can also show the GMT+X difference as part of the label, then include this component similarly on the appointment section.

@harad1 Internally, @50bbx and I used UTC; you can see this for example by the call to /book (which is all done in UTC). UTC works with all calendars regardless of the timezone. Even though this works theoretically; it needs double checking. In addition, the reason there is some options in the dropdown selector that seem awfully specific (Like "Europe/Bucharest") this has the reason that they handle DST differently; Bucharest for example enters and leaves DST one hour later (at 3am) than the rest of Europe (mostly 2am).

from cal.com.

50bbx avatar 50bbx commented on August 25, 2024

Ok, I tried to add the TimeZone selector used here. But now it is really hard to use it with dayjs.tz.guess().

In the pages/[user]/[type].tsx file these are the critical changes:

export default function Type(props) {
  //...
  const [selectedTimeZone, setSelectedTimeZone] = useState(dayjs.tz.guess());
  //...
  return (
    <TimezoneSelect id="timeZone" value={selectedTimeZone} onChange={setSelectedTimeZone} className="shadow-sm focus:ring-blue-500 focus:border-blue-500 mt-1 block w-full sm:text-sm border-gray-300 rounded-md" />
  )
}

In my case dayjs.tz.guess() returns Europe/Rome, but react-timezone-select aggregates timezones and Europe/Rome is not present, only Europe/Amsterdam and Europe/Brussels are.

Basically, setting value this way, defaulting to the dayjs.tz.guess() for the selector does not work. This means that if we use this component on the appointment booking page, we need to find a way to aggregate timezones the same way.

from cal.com.

ulentini avatar ulentini commented on August 25, 2024

From what I can see, react-timezone-select support all official Timezone names (because the spacetime package supports them), but it provides just a subset of them (removing duplicates).
If a complete list of timezones is passed in the timezones attribute, dayjs.tz.guess() can still be used.

from cal.com.

emrysal avatar emrysal commented on August 25, 2024

@50bbx With v1.0.2 this should now be possible 👍

from cal.com.

emrysal avatar emrysal commented on August 25, 2024

@abrambailey I think this just got fixed in #181 - could you confirm?

from cal.com.

abrambailey avatar abrambailey commented on August 25, 2024

Happy to help, has code been deployed to https://calendso.com/rick/quick-chat ?

from cal.com.

baileypumfleet avatar baileypumfleet commented on August 25, 2024

from cal.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.