Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timezone select to Jetstream profile page? #73

Open
seabasss opened this issue Aug 14, 2021 · 1 comment
Open

Add timezone select to Jetstream profile page? #73

seabasss opened this issue Aug 14, 2021 · 1 comment

Comments

@seabasss
Copy link

Is there any way to add a timezone select to the Jetstream profile page? I only want to set timezone automatically when the user first log in and then let them change it under profile settings.

Has anyone built a select like that? I tried to add one, but quickly added up deep in laravel/jetstream core folders and figured I better ask here first.

Thanks!

@sirmews
Copy link

sirmews commented Sep 2, 2021

@seabasss
I've done this by:

First edit the component for user profile:
resources/views/profile/update-profile-information-form.blade.php

Add a select here with a list of timezones. You can get a timezone list using listidentifiers

Then allow the timezone input in app/Actions/Fortify/UpdateUserProfileInformation.php . You'll notice this is where the User model is updated, pass in the appropriate timezone value.

You'll want to add timezone to your user Model's $fillable if you resort to using the default $user->forceFill

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants