Date, timezone, days of week

Hi forum.

It seems like I am not very bright :slight_smile:.
I have the following problem:

saving hour availability on recurrent days.
So far I know I can extract days as 0 - Sunday, 1 - Monday … 6 - Saturday.
I know that bubble saves current user’s time zone and is displaying the saved time in current user’s time zone.
What I cannot figure out is how to change days of the week based on timezone.

Here’s an example:

User A will save for Monday the hour interval 1 am - 2 am.
User B is 3 hour behind, meaning that for him/her it will be 10 pm - 11 pm.
I have no problem showing the time based on timezones, BUT, User’s A Monday will be in fact User’s B Sunday.

So while User A lives in the future and it’s 1am Monday, User B lives in the past, 3 hours behind, in Sunday at 10 pm.

Given this, bubble will change only the hours, not the day also.

How to achieve this?
I’m not political, but I will use trumps many in this: many, many, many thanks :slight_smile:

Making a calendar booking system at the moment.

It can be a nightmare.

I think the missing information in your thought process is that bubble saves Unix time. Not the users timezone information.

Time is displayed relative to the browser timezone.

But in the database, it’s a Unix timestamp. I would disregard timezone information in calculations. Timezone is only for viewing things.

Hope that nugget of info let’s you continue the journey. On phone and gtg…

Regards
ZubairLK

Co-founder @ MillionLabs.co.uk

This topic was automatically closed after 70 days. New replies are no longer allowed.