Skip to content

Commit e92fc00

Browse files
ptomato12wrigja
authored andcommitted
Move time zone annotation parsing into ParseISODateTime
Now that annotations are an integral part of IXDTF strings, it's better to handle them at the same time inside of ParseISODateTime. This work is preparatory to the normative change that we will have to do to accept the annotation format defined in IXDTF. (IXDTF is the working abbreviation of the IETF draft; it stands for Internet Extended Date-Time Format) Previously we would call ParseISODateTime on a string and subsequently ParseTemporalTimeZoneString on the same string. In addition to the benefit mentioned above, the previous situation could also lead to confusion since it parsed the string twice, and ParseTemporalTimeZoneString also accepts a bare time zone identifier (even though that branch of the grammar is not used in this case, because a bare time zone identifier can never be a valid ISO string.) Now, the Record returned by ParseISODateTime gains a [[TimeZone]] field which contains another Record of the same type that is returned by ParseTemporalTimeZoneString. UPSTREAM_COMMIT=c410e25e4761bd9c86880219558d25074d28839f
1 parent b86b87f commit e92fc00

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lib/ecmascript.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,7 @@ function ParseISODateTime(isoString: string) {
402402
}
403403
if (offset === '-00:00') offset = '+00:00';
404404
}
405-
let ianaName = match[19];
406-
if (ianaName) {
407-
try {
408-
// Canonicalize name if it is an IANA link name or is capitalized wrong
409-
ianaName = GetCanonicalTimeZoneIdentifier(ianaName).toString();
410-
} catch {
411-
// Not an IANA name, may be a custom ID, pass through unchanged
412-
}
413-
}
405+
const ianaName = match[19];
414406
const calendar = match[20];
415407
RejectDateTime(year, month, day, hour, minute, second, millisecond, microsecond, nanosecond);
416408
return {

0 commit comments

Comments
 (0)