0

I am developing an app that allows users to book a chat session with therapists. I have already made the model and it works well but when you only consider one time zone. Currently, I have 20 time slots each representing a specific time. For example, slot 0 => 08:00, slot 1 => 08:45 and so on.. When the user books a session i disable the slot.

Everything works well when both users are in the same time zone, but when they are in different time zones it does not work because the time periods are hardcoded and for example if the timezones is +02:30 from the one where the therapist is, there might not be a time slot that is suited (example 08:30 => 09:15).

I would like some help for how I should structure the data in order to be able to cover the different time zones case. The project is already live and uses firestore, so i need a solution using the same db.

James Z
  • 12,209
  • 10
  • 24
  • 44
Hoqur
  • 21
  • 2
  • Hello. You seem to be asking for general advice about how to work with time zones in your application. That's pretty broad, and [has been covered many times](https://stackoverflow.com/q/2532729/634824). If you need help with your data structure, then *ask* a specific question about that. Show your attempt, state what's working, what isn't, what happened, what you expect, etc. Please read [*How do I ask a good question?*](https://stackoverflow.com/help/how-to-ask) from the help center. Thanks. – Matt Johnson-Pint Aug 19 '20 at 17:57
  • 1
    @MattJohnson-Pint Hey! Thanks for the great advice. I suppose i did not understand my problem very well in order to be more specific. However, I managed to implement what i wanted in the past few hours. I am sorry for not researching enough on how to ask good question and will work on that before I ask anything else! Cheers and have a good day =) – Hoqur Aug 20 '20 at 13:21
  • @Hoqur Hi! How did you solve the timeZone problem? – Chamanhm Jan 28 '21 at 19:27
  • @Chamanhm Hey, I save the locale of both the users (patient and therapist) and than figure out the difference in hours between the timeZones and book the suitable slot. – Hoqur Jan 30 '21 at 15:27
  • @Hoqur do you save the number? Or the name for the timeZone? And do you have any trouble when a booked therapy (for example the therapist) enters daylight savings time? – Chamanhm Jan 30 '21 at 19:32
  • 1
    @Chamanhm I save the name of the timeZone and haven't had any problems so far – Hoqur Feb 01 '21 at 18:03

0 Answers0