First, create a new Stimulus controller. Here, we've title it time_zone_setter_controller.js
. This controller does one thing: when the controller connects, it updates the value of the field
target to the browser's reported time zone.
It reads:
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {