TylerAHolden / react-schedule-meeting

https://react-schedule-meeting.netlify.app/
MIT License
54 stars 17 forks source link

Time Zone support #70

Open AlexanderKapelyukhovskiy opened 1 year ago

AlexanderKapelyukhovskiy commented 1 year ago

In my case I have an advisor with available time slots and a customer who needs to pick available time. Advisors and customer could be in different time zones. I wasn't able to find time zone support for component. Could you please clarify is there a support of TimeZones in component and if not how hard it would be to adjust code for time zone support?

TylerAHolden commented 10 months ago

Hi did you see the locale prop here: https://react-schedule-meeting.netlify.app/docs/examples/#internationalization--languages would this fit your use case where you need to modify the timezones for either the advisor or customer?

AlexanderKapelyukhovskiy commented 10 months ago

I saw this page but I'm still not sure how can I specify time zone here. I would like to be able to specify time zone for representation of time slots and do not use default browser time zone. Hope it makes sense.

TylerAHolden commented 10 months ago

Oh I understand, no unfortunately there is no support for this. I believe in order to achieve something like that another library is needed to transform date-fns date objects. https://date-fns.org/v2.29.2/docs/Time-Zones

The problem is that this library uses the direct date-fns date object without allowing a transform function. I might have time in the next couple of months to look into a solution where you could pass in a transform function. I've been wanting to refactor how localization is handled anyways but don't count on me to get to this quickly