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

Fix: Don't rely on jquery when detecting user timezone #843

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

jagthedrummer
Copy link
Contributor

We recently remove the global jQuery alias $ in an effort to work towards eliminationg jquery completely. This PR changes the timezone detection that happens when we edit user details to not rely on jQuery at all, global or otherwise.

Fixes: bullet-train-co/bullet_train#1504

We recently remove the global `jQuery` alias `$` in an effort to work
towards eliminationg jquery completely. This PR changes the timezone
detection that happens when we edit user details to not rely on jQuery
at all, global or otherwise.

Fixes: bullet-train-co/bullet_train#1504
Comment on lines -70 to -73
// update the select2 as well. is there a better way to handle this?
// why don't _they_ handle this for us?
$("#select2-user_time_zone-container").attr('title', $option.text());
$("#select2-user_time_zone-container").text($option.text());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines don't seem to be necessary anymore. Setting the value attribute on the select element itself (#user_time_zone) now seems to make select2 automatically update.

@jagthedrummer jagthedrummer merged commit ede1025 into main Jun 5, 2024
30 checks passed
@jagthedrummer jagthedrummer deleted the jeremy/user-details-timezone-fix branch June 5, 2024 16:14
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

Successfully merging this pull request may close these issues.

Timezone detection is off or not working
1 participant