📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
moved timezone preference into it's own section
Blue Mousec3edae847bef
diff --git a/public/locales/en.json b/public/locales/en.jsonindex 709e0d226..ebd272522 100644--- a/public/locales/en.json+++ b/public/locales/en.json@@ -178,6 +178,7 @@"general": "General settings","update": "Update profile","email": "Email reports",+ "timezone": "Timezone preference","frequency": "How often should we send you an email summary about your websites?","noLink": "Didn't receive a link to confirm the email address? Request a new one!","requestExport": "Request data export",@@ -196,7 +197,7 @@"confTimeout": "An email has already been sent, check your mailbox or try again in a few minutes","confSent": "An account confirmation link has been sent to your email","noConfLeft": "Unfortunately, you've ran out of your email confirmation requests.\nPlease make sure you are able to receive e-mails and check your SPAM folder again for messages.\nYou may try to use a different email address or contact our customer support service.",- "timezone": "The time zone preference.\nThis will be the time zone in which the data is displayed. It's only used for visualization.\nNo data will be modified based on this setting."+ "timezoneDesc": "This will be the time zone in which the data is displayed. It's only used for visualization.\nNo data will be modified based on this setting."},"dashboard": {"newProject": "New project",diff --git a/src/pages/UserSettings/UserSettings.jsx b/src/pages/UserSettings/UserSettings.jsxindex 77d125e9b..38b8078ba 100644--- a/src/pages/UserSettings/UserSettings.jsx+++ b/src/pages/UserSettings/UserSettings.jsx@@ -64,12 +64,20 @@ const UserSettings = ({e.stopPropagation()setBeenSubmitted(true)- // if the timezone updates, we need to delete all project cache to refetch it with the new timezone setting afterwards- if (timezoneChanged) {- onDeleteProjectCache()+ if (validated) {+ onSubmit(form)}+ }++ const handleTimezoneSave = () => {+ setBeenSubmitted(true)if (validated) {+ // if the timezone updates, we need to delete all project cache to refetch it with the new timezone setting afterwards+ if (timezoneChanged) {+ onDeleteProjectCache()+ }+onSubmit({...form,timezone,@@ -155,14 +163,6 @@ const UserSettings = ({error={beenSubmitted ? errors.repeat : null}/></div>- <div className='grid grid-cols-1 gap-y-6 gap-x-4 lg:grid-cols-2 mt-4'>- <div>- <TimezonePicker- value={timezone}- onChange={_setTimezone}- />- </div>- </div><Button className='mt-4' type='submit' primary large>{t('profileSettings.update')}</Button>@@ -185,6 +185,21 @@ const UserSettings = ({{t('common.save')}</Button><hr className='mt-5' />+ <h3 className='mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>+ {t('profileSettings.timezone')}+ </h3>+ <div className='grid grid-cols-1 gap-y-6 gap-x-4 lg:grid-cols-2 mt-4'>+ <div>+ <TimezonePicker+ value={timezone}+ onChange={_setTimezone}+ />+ </div>+ </div>+ <Button className='mt-4' onClick={handleTimezoneSave} primary large>+ {t('common.save')}+ </Button>+ <hr className='mt-5' />{!user.isActive && (<div href='#' className='flex cursor-pointer mt-4 pl-0 underline text-blue-600 hover:text-indigo-800' onClick={() => onEmailConfirm(setError)}><MailIcon className='mt-0.5 mr-2 w-6 h-6 text-blue-500' />diff --git a/src/ui/TimezonePicker.jsx b/src/ui/TimezonePicker.jsxindex 913099f8d..7dbbb9020 100644--- a/src/ui/TimezonePicker.jsx+++ b/src/ui/TimezonePicker.jsx@@ -58,7 +58,7 @@ const TimezoneSelect = ({return (<Selecttitle={labelExtractor(parseTimezone(value))}- label={t('profileSettings.timezone')}+ label={t('profileSettings.timezoneDesc')}className='w-full'items={options}labelExtractor={labelExtractor}