@yext/phonenumber-util 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/pull-request.yml +17 -0
- package/CODEOWNERS +1 -1
- package/README.md +96 -5
- package/package.json +8 -3
- package/src/__tests__/{index.test.js → base.test.js} +1 -1
- package/src/__tests__/geo.test.js +286 -0
- package/src/areaCodeList.js +13 -0
- package/src/compliance.js +31 -0
- package/src/daylightSavings.js +21 -0
- package/src/geo.d.ts +31 -0
- package/src/geo.js +257 -0
- package/src/phoneCodes.js +665 -0
- package/src/timezones.js +148 -0
- /package/src/{index.d.ts → base.d.ts} +0 -0
- /package/src/{index.js → base.js} +0 -0
package/src/timezones.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export const STATE_TIMEZONES = {
|
|
2
|
+
Alabama: '-06:00',
|
|
3
|
+
Alaska: '-09:00',
|
|
4
|
+
'American Samoa': '-11:00',
|
|
5
|
+
Arizona: '-07:00',
|
|
6
|
+
Arkansas: '-06:00',
|
|
7
|
+
California: '-08:00',
|
|
8
|
+
Colorado: '-07:00',
|
|
9
|
+
Connecticut: '-05:00',
|
|
10
|
+
Delaware: '-05:00',
|
|
11
|
+
Florida: '-05:00',
|
|
12
|
+
Georgia: '-05:00',
|
|
13
|
+
Guam: '+10:00',
|
|
14
|
+
Grenada: '-04:00',
|
|
15
|
+
Hawaii: '-10:00',
|
|
16
|
+
Idaho: '-07:00',
|
|
17
|
+
Illinois: '-06:00',
|
|
18
|
+
Indiana: '-05:00',
|
|
19
|
+
Iowa: '-06:00',
|
|
20
|
+
Kansas: '-06:00',
|
|
21
|
+
Kentucky: '-05:00',
|
|
22
|
+
Louisiana: '-06:00',
|
|
23
|
+
Maine: '-05:00',
|
|
24
|
+
Maryland: '-05:00',
|
|
25
|
+
Massachusetts: '-05:00',
|
|
26
|
+
Michigan: '-05:00',
|
|
27
|
+
Minnesota: '-06:00',
|
|
28
|
+
Mississippi: '-06:00',
|
|
29
|
+
Missouri: '-06:00',
|
|
30
|
+
Montana: '-07:00',
|
|
31
|
+
Nebraska: '-06:00',
|
|
32
|
+
Nevada: '-08:00',
|
|
33
|
+
'New Hampshire': '-05:00',
|
|
34
|
+
'New Jersey': '-05:00',
|
|
35
|
+
'New Mexico': '-07:00',
|
|
36
|
+
'New York': '-05:00',
|
|
37
|
+
'North Carolina': '-05:00',
|
|
38
|
+
'North Dakota': '-06:00',
|
|
39
|
+
'Northern Mariana Islands': '+10:00',
|
|
40
|
+
Ohio: '-05:00',
|
|
41
|
+
Oklahoma: '-06:00',
|
|
42
|
+
Oregon: '-08:00',
|
|
43
|
+
Pennsylvania: '-05:00',
|
|
44
|
+
'Puerto Rico': '-04:00',
|
|
45
|
+
'Rhode Island': '-05:00',
|
|
46
|
+
'South Carolina': '-05:00',
|
|
47
|
+
'South Dakota': '-06:00',
|
|
48
|
+
Tennessee: '-06:00',
|
|
49
|
+
Texas: '-06:00',
|
|
50
|
+
Utah: '-07:00',
|
|
51
|
+
Vermont: '-05:00',
|
|
52
|
+
'Virgin Islands': '-04:00',
|
|
53
|
+
Virginia: '-05:00',
|
|
54
|
+
Washington: '-08:00',
|
|
55
|
+
'Washington, DC': '-04:00',
|
|
56
|
+
'West Virginia': '-05:00',
|
|
57
|
+
Wisconsin: '-06:00',
|
|
58
|
+
Wyoming: '-07:00',
|
|
59
|
+
// Canadian Provinces
|
|
60
|
+
Alberta: '-07:00',
|
|
61
|
+
'British Columbia': '-07:00',
|
|
62
|
+
Manitoba: '-06:00',
|
|
63
|
+
'New Brunswick': '-04:00',
|
|
64
|
+
'Newfoundland and Labrador': '-03:30',
|
|
65
|
+
'Northwest Territories': '-07:00',
|
|
66
|
+
'Nova Scotia': '-04:00',
|
|
67
|
+
Nunavut: '-05:00',
|
|
68
|
+
Ontario: '-05:00',
|
|
69
|
+
'Nova Scotia and Prince Edward Island': '-04:00',
|
|
70
|
+
Quebec: '-05:00',
|
|
71
|
+
Saskatchewan: '-06:00',
|
|
72
|
+
Yukon: '-07:00',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// We refer to STATE_TIMEZONES for the default timezone for each state.
|
|
76
|
+
// This list is for exceptions for area codes within those states.
|
|
77
|
+
export const STATES_WITH_MULTIPLE_TIMEZONES = {
|
|
78
|
+
Alaska: {
|
|
79
|
+
907: ['-09:00', '-10:00'],
|
|
80
|
+
},
|
|
81
|
+
Florida: {
|
|
82
|
+
850: '-06:00',
|
|
83
|
+
448: '-06:00',
|
|
84
|
+
},
|
|
85
|
+
Idaho: {
|
|
86
|
+
208: ['-07:00', '-08:00'],
|
|
87
|
+
986: ['-07:00', '-08:00'],
|
|
88
|
+
},
|
|
89
|
+
Indiana: {
|
|
90
|
+
219: ['-05:00', '-06:00'],
|
|
91
|
+
574: ['-05:00', '-06:00'],
|
|
92
|
+
812: ['-05:00', '-06:00'],
|
|
93
|
+
930: ['-05:00', '-06:00'],
|
|
94
|
+
},
|
|
95
|
+
Kansas: {
|
|
96
|
+
620: ['-06:00', '-07:00'],
|
|
97
|
+
785: ['-06:00', '-07:00'],
|
|
98
|
+
},
|
|
99
|
+
Kentucky: {
|
|
100
|
+
270: ['-05:00', '-06:00'],
|
|
101
|
+
364: ['-05:00', '-06:00'],
|
|
102
|
+
},
|
|
103
|
+
Michigan: {
|
|
104
|
+
906: ['-05:00', '-06:00'],
|
|
105
|
+
},
|
|
106
|
+
Nebraska: {
|
|
107
|
+
308: ['-06:00', '-07:00'],
|
|
108
|
+
402: ['-06:00', '-07:00'],
|
|
109
|
+
531: ['-06:00', '-07:00'],
|
|
110
|
+
},
|
|
111
|
+
'North Dakota': {
|
|
112
|
+
701: ['-06:00', '-07:00'],
|
|
113
|
+
},
|
|
114
|
+
Oregon: {
|
|
115
|
+
458: ['-08:00', '-07:00'],
|
|
116
|
+
541: ['-08:00', '-07:00'],
|
|
117
|
+
},
|
|
118
|
+
'South Dakota': {
|
|
119
|
+
605: ['-06:00', '-07:00'],
|
|
120
|
+
},
|
|
121
|
+
Tennessee: {
|
|
122
|
+
423: ['-05:00', '-06:00'],
|
|
123
|
+
729: ['-05:00', '-06:00'],
|
|
124
|
+
865: ['-05:00', '-06:00'],
|
|
125
|
+
},
|
|
126
|
+
Texas: {
|
|
127
|
+
432: ['-06:00', '-07:00'],
|
|
128
|
+
915: '-07:00',
|
|
129
|
+
},
|
|
130
|
+
// Canadian Provinces
|
|
131
|
+
'British Columbia': {
|
|
132
|
+
236: ['-06:00', '-07:00'],
|
|
133
|
+
250: ['-06:00', '-07:00'],
|
|
134
|
+
257: ['-06:00', '-07:00'],
|
|
135
|
+
672: ['-06:00', '-07:00'],
|
|
136
|
+
778: ['-06:00', '-07:00'],
|
|
137
|
+
},
|
|
138
|
+
Ontario: {
|
|
139
|
+
807: ['-05:00', '-06:00'],
|
|
140
|
+
},
|
|
141
|
+
Quebec: {
|
|
142
|
+
418: ['-04:00'],
|
|
143
|
+
},
|
|
144
|
+
'Newfoundland and Labrador': {
|
|
145
|
+
709: ['-03:30', '-04:00'],
|
|
146
|
+
879: ['-03:30', '-04:00'],
|
|
147
|
+
},
|
|
148
|
+
};
|
|
File without changes
|
|
File without changes
|