@@ -83,7 +83,7 @@ export default class IANAZone extends Zone {
83
83
* @param {string } s - The string to check validity on
84
84
* @example IANAZone.isValidSpecifier("America/New_York") //=> true
85
85
* @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false
86
- * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.
86
+ * @deprecated For backward compatibility, this forwards to isValidZone, better use ` isValidZone()` directly instead.
87
87
* @return {boolean }
88
88
*/
89
89
static isValidSpecifier ( s ) {
@@ -118,32 +118,65 @@ export default class IANAZone extends Zone {
118
118
this . valid = IANAZone . isValidZone ( name ) ;
119
119
}
120
120
121
- /** @override **/
121
+ /**
122
+ * The type of zone. `iana` for all instances of `IANAZone`.
123
+ * @override
124
+ * @type {string }
125
+ */
122
126
get type ( ) {
123
127
return "iana" ;
124
128
}
125
129
126
- /** @override **/
130
+ /**
131
+ * The name of this zone (i.e. the IANA zone name).
132
+ * @override
133
+ * @type {string }
134
+ */
127
135
get name ( ) {
128
136
return this . zoneName ;
129
137
}
130
138
131
- /** @override **/
139
+ /**
140
+ * Returns whether the offset is known to be fixed for the whole year:
141
+ * Always returns false for all IANA zones.
142
+ * @override
143
+ * @type {boolean }
144
+ */
132
145
get isUniversal ( ) {
133
146
return false ;
134
147
}
135
148
136
- /** @override **/
149
+ /**
150
+ * Returns the offset's common name (such as EST) at the specified timestamp
151
+ * @override
152
+ * @param {number } ts - Epoch milliseconds for which to get the name
153
+ * @param {Object } opts - Options to affect the format
154
+ * @param {string } opts.format - What style of offset to return. Accepts 'long' or 'short'.
155
+ * @param {string } opts.locale - What locale to return the offset name in.
156
+ * @return {string }
157
+ */
137
158
offsetName ( ts , { format, locale } ) {
138
159
return parseZoneInfo ( ts , format , locale , this . name ) ;
139
160
}
140
161
141
- /** @override **/
162
+ /**
163
+ * Returns the offset's value as a string
164
+ * @override
165
+ * @param {number } ts - Epoch milliseconds for which to get the offset
166
+ * @param {string } format - What style of offset to return.
167
+ * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively
168
+ * @return {string }
169
+ */
142
170
formatOffset ( ts , format ) {
143
171
return formatOffset ( this . offset ( ts ) , format ) ;
144
172
}
145
173
146
- /** @override **/
174
+ /**
175
+ * Return the offset in minutes for this zone at the specified timestamp.
176
+ * @override
177
+ * @param {number } ts - Epoch milliseconds for which to compute the offset
178
+ * @return {number }
179
+ */
147
180
offset ( ts ) {
148
181
const date = new Date ( ts ) ;
149
182
@@ -177,12 +210,21 @@ export default class IANAZone extends Zone {
177
210
return ( asUTC - asTS ) / ( 60 * 1000 ) ;
178
211
}
179
212
180
- /** @override **/
213
+ /**
214
+ * Return whether this Zone is equal to another zone
215
+ * @override
216
+ * @param {Zone } otherZone - the zone to compare
217
+ * @return {boolean }
218
+ */
181
219
equals ( otherZone ) {
182
220
return otherZone . type === "iana" && otherZone . name === this . name ;
183
221
}
184
222
185
- /** @override **/
223
+ /**
224
+ * Return whether this Zone is valid.
225
+ * @override
226
+ * @type {boolean }
227
+ */
186
228
get isValid ( ) {
187
229
return this . valid ;
188
230
}
0 commit comments