Set request timezone to match browser
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.#setTimezoneCookie()
|
||||
}
|
||||
|
||||
#setTimezoneCookie() {
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
document.cookie = `timezone=${encodeURIComponent(timezone)}; path=/`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user