mirror of https://github.com/docusealco/docuseal
parent
26f7d5cf0d
commit
cdd034e72d
@ -1,7 +1,21 @@
|
||||
export default class extends HTMLElement {
|
||||
connectedCallback () {
|
||||
if (this.dataset.inputId) {
|
||||
document.getElementById(this.dataset.inputId).value = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
|
||||
if (this.dataset.params === 'true') {
|
||||
const params = new URLSearchParams(this.input.value)
|
||||
|
||||
params.set('timezone', timezone)
|
||||
|
||||
this.input.value = params.toString()
|
||||
} else {
|
||||
this.input.value = timezone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get input () {
|
||||
return document.getElementById(this.dataset.inputId)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue