mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
feat: Add timezone dropdown to user profile page
This commit adds a new dropdown component for selecting the timezone on the user profile page. The dropdown options are populated using the `TimezoneCode` enum from the `Common/Types/TimezoneCode.ts` file. Users can now select their timezone, which will be used for all date and time related notifications sent to them. This enhancement improves the user experience by providing a convenient way to set the timezone preference.
This commit is contained in:
parent
0d97f0447a
commit
1d6a7ee1fa
63
Common/Types/TimezoneCode.ts
Normal file
63
Common/Types/TimezoneCode.ts
Normal file
@ -0,0 +1,63 @@
|
||||
enum TimezoneCode {
|
||||
UTC = 'UTC',
|
||||
GMT = 'GMT',
|
||||
EST = 'EST',
|
||||
EDT = 'EDT',
|
||||
CST = 'CST',
|
||||
CDT = 'CDT',
|
||||
MST = 'MST',
|
||||
MDT = 'MDT',
|
||||
PST = 'PST',
|
||||
PDT = 'PDT',
|
||||
AKST = 'AKST',
|
||||
AKDT = 'AKDT',
|
||||
HST = 'HST',
|
||||
HDT = 'HDT',
|
||||
AEST = 'AEST',
|
||||
AEDT = 'AEDT',
|
||||
ACST = 'ACST',
|
||||
ACDT = 'ACDT',
|
||||
AWST = 'AWST',
|
||||
AWDT = 'AWDT',
|
||||
NZST = 'NZST',
|
||||
NZDT = 'NZDT',
|
||||
NFT = 'NFT',
|
||||
IDLW = 'IDLW',
|
||||
NT = 'NT',
|
||||
CAT = 'CAT',
|
||||
EAT = 'EAT',
|
||||
IST = 'IST',
|
||||
MSK = 'MSK',
|
||||
EET = 'EET',
|
||||
CET = 'CET',
|
||||
WAT = 'WAT',
|
||||
GMT1 = 'GMT+1',
|
||||
GMT2 = 'GMT+2',
|
||||
GMT3 = 'GMT+3',
|
||||
GMT4 = 'GMT+4',
|
||||
GMT5 = 'GMT+5',
|
||||
GMT6 = 'GMT+6',
|
||||
GMT7 = 'GMT+7',
|
||||
GMT8 = 'GMT+8',
|
||||
GMT9 = 'GMT+9',
|
||||
GMT10 = 'GMT+10',
|
||||
GMT11 = 'GMT+11',
|
||||
GMT12 = 'GMT+12',
|
||||
GMT13 = 'GMT+13',
|
||||
GMT14 = 'GMT+14',
|
||||
GMT_1 = 'GMT-1',
|
||||
GMT_2 = 'GMT-2',
|
||||
GMT_3 = 'GMT-3',
|
||||
GMT_4 = 'GMT-4',
|
||||
GMT_5 = 'GMT-5',
|
||||
GMT_6 = 'GMT-6',
|
||||
GMT_7 = 'GMT-7',
|
||||
GMT_8 = 'GMT-8',
|
||||
GMT_9 = 'GMT-9',
|
||||
GMT_10 = 'GMT-10',
|
||||
GMT_11 = 'GMT-11',
|
||||
GMT_12 = 'GMT-12',
|
||||
GMT_13 = 'GMT-13',
|
||||
}
|
||||
|
||||
export default TimezoneCode;
|
@ -3,9 +3,11 @@ import RouteMap, { RouteUtil } from '../../../Utils/RouteMap';
|
||||
import PageComponentProps from '../../PageComponentProps';
|
||||
import SideMenu from './SideMenu';
|
||||
import Route from 'Common/Types/API/Route';
|
||||
import TimezoneCode from 'Common/Types/TimezoneCode';
|
||||
import FormFieldSchemaType from 'CommonUI/src/Components/Forms/Types/FormFieldSchemaType';
|
||||
import CardModelDetail from 'CommonUI/src/Components/ModelDetail/CardModelDetail';
|
||||
import Page from 'CommonUI/src/Components/Page/Page';
|
||||
import DropdownUtil from 'CommonUI/src/Utils/Dropdown';
|
||||
import UserUtil from 'CommonUI/src/Utils/User';
|
||||
import User from 'Model/Models/User';
|
||||
import React, { FunctionComponent, ReactElement } from 'react';
|
||||
@ -60,6 +62,21 @@ const Home: FunctionComponent<PageComponentProps> = (
|
||||
required: true,
|
||||
title: 'Full Name',
|
||||
},
|
||||
{
|
||||
field: {
|
||||
timezone: true,
|
||||
},
|
||||
fieldType: FormFieldSchemaType.Dropdown,
|
||||
dropdownOptions:
|
||||
DropdownUtil.getDropdownOptionsFromEnum(
|
||||
TimezoneCode
|
||||
),
|
||||
placeholder: 'Select Timezone',
|
||||
description:
|
||||
'Select your timezone. This will be used for all date and time related notifications sent out to you.',
|
||||
required: false,
|
||||
title: 'Timezone',
|
||||
},
|
||||
]}
|
||||
modelDetailProps={{
|
||||
showDetailsInNumberOfColumns: 2,
|
||||
@ -78,6 +95,13 @@ const Home: FunctionComponent<PageComponentProps> = (
|
||||
},
|
||||
title: 'Email',
|
||||
},
|
||||
{
|
||||
field: {
|
||||
timezone: true,
|
||||
},
|
||||
title: 'Timezone',
|
||||
placeholder: 'No timezone selected',
|
||||
},
|
||||
],
|
||||
modelId: UserUtil.getUserId(),
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user