app/views/account/onboarding/user_details/edit.html.erb in bullet_train-1.6.24 vs app/views/account/onboarding/user_details/edit.html.erb in bullet_train-1.6.25

- old
+ new

@@ -28,11 +28,11 @@ <% end %> <div class="sm:col-span-2"> <%= render 'shared/fields/super_select', form: f, method: :time_zone, choices: time_zone_options_for_select(@user.time_zone, nil, ActiveSupport::TimeZone), - other_options: {search: true, required: true} %> + other_options: {search: true, required: true, use_browser_time_zone: true} %> </div> </div> <div class="buttons"> <%= f.submit t('.buttons.next'), class: first_button_primary %> @@ -58,16 +58,20 @@ } // figure out the rails timezone value. var railsValue = jsTimezoneMapping[jstz.determine().name()]; - // set the form accordingly. - var $option = $("#user_time_zone option[value=\"" + railsValue + "\"]") - $option.prop('selected', true); + var useBrowserTimeZone = $("#user_time_zone")[0].dataset.useBrowserTimeZone - // 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()); + if (useBrowserTimeZone == "true") { + // set the form accordingly. + var $option = $("#user_time_zone option[value=\"" + railsValue + "\"]") + $option.prop('selected', true); + + // 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()); + } }); </script>