Hi,
I know Bubble offers the possibility to user dynamic time zone for each user to select its preference.

Can someone please explain me how to setup the database field for “user’s preferred time zone”?
And also how to setup the frontend part (for the user to select its preferred time zone).
Thanks!
You will need to create “Preferred Timezone” text field on the User type and initialize it on page load if it’s empty.
To get current browser’s timezone, use script from here: timezone - Getting the client’s time zone (and offset) in JavaScript - Stack Overflow, invoke it using Misha’s Toolbox Plugin | Bubble and populate timezone in JavascriptToBubble element. Now you can initialize your timezone field when it’s empty.
Next step is to add Preferred Timezone field to User Prorfile page and to bind it to Current User object. You could choose alternative ways to update this field, the final purpose is to update it, no matter how.
So basically it’s done and you can use Current User’s timezone field as dynamic timezone when formatting dates.
Your sample described here: S4vy66wh2g7jddv5 | Bubble Editor
Will be available for a week. PM me if you need it trasferred to you.
2 Likes