1+ import moment from 'moment-timezone' ;
2+
13export const DATE_SECTION_ID = 5 ;
24
35export const DEFAULT_DATE_SETTING_TIMEZONE = 'UTC' ;
@@ -6,7 +8,19 @@ export const DEFAULT_DATE_SETTING_DATE = 'medium';
68export const DATE_SETTING_TIMEZONE_SHORT = 'utmstack.time.zone' ;
79export const DATE_SETTING_FORMAT_SHORT = 'utmstack.time.dateformat' ;
810
9- export const TIMEZONES : Array < { label : string ; timezone : string , zone : string } > = [
11+ export const TIMEZONES : Array < { label : string ; timezone : string ; zone : string } > =
12+ moment . tz . names ( ) . map ( ( tz ) => {
13+ const parts = tz . split ( '/' ) ;
14+ const zone = parts [ 0 ] || 'Other' ;
15+ const label = tz . replace ( / _ / g, ' ' ) ;
16+ return {
17+ label,
18+ timezone : tz ,
19+ zone
20+ } ;
21+ } ) ;
22+
23+ /*export const TIMEZONES: Array<{ label: string; timezone: string, zone: string }> = [
1024 {label: 'UTC', timezone: 'UTC', zone: 'UTC'},
1125 {label: 'Eastern Standard Time (New York)', timezone: 'America/New_York', zone: 'America'},
1226 {label: 'Pacific Standard Time (Los Angeles)', timezone: 'America/Los_Angeles', zone: 'America'},
@@ -38,7 +52,7 @@ export const TIMEZONES: Array<{ label: string; timezone: string, zone: string }>
3852 {label: 'Jerusalem (IST)', timezone: 'Asia/Jerusalem', zone: 'Asia'},
3953 {label: 'Buenos Aires (ART)', timezone: 'America/Argentina/Buenos_Aires', zone: 'America'},
4054 {label: 'São Paulo (BRT)', timezone: 'America/Sao_Paulo', zone: 'America'},
41- ] ;
55+ ];*/
4256
4357export const DATE_FORMATS : Array < { label : string ; format : string ; equivalentTo : string } > = [
4458 { label : 'Short' , format : 'short' , equivalentTo : 'M/d/yy, h:mm a' } ,
0 commit comments