feat: default timezone to user's local timezone in activate form (#5374)

pull/5395/head
Charles Zhou 2 years ago committed by GitHub
parent a965d1ac98
commit 2b0c779173
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -41,10 +41,9 @@ const ActivateForm = () => {
const [name, setName] = useState('')
const [password, setPassword] = useState('')
const [timezone, setTimezone] = useState('Asia/Shanghai')
const [timezone, setTimezone] = useState(Intl.DateTimeFormat().resolvedOptions().timeZone)
const [language, setLanguage] = useState(locale)
const [showSuccess, setShowSuccess] = useState(false)
const defaultLanguage = useCallback(() => (window.navigator.language.startsWith('zh') ? LanguagesSupported[1] : LanguagesSupported[0]) || LanguagesSupported[0], [])
const showErrorMessage = useCallback((message: string) => {
Toast.notify({

Loading…
Cancel
Save