Previews

No matching results.

Pages

No matching results.

x
1
<span></span>
1
<span><%= cookies[:timezone] %></span>
CSS is not required or multiple files are needed, check the notes.
1
2
3
4
5
6
7
8
9
10
11
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
connect() {
document.cookie = `timezone=${encodeURIComponent(this.#timezone)}; path=/`
}
get #timezone() {
return Intl.DateTimeFormat().resolvedOptions().timeZone
}
}