1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

LibJS: Do not negate offset in LocalTZA for isUTC=false

In commmit 7d2834344a, I think I combined
the definitions of the LocalTZA and UTC AOs in my head, and thought the
offset should be negated within LocalTZA. Instead, the offset should be
left untouched, and the UTC AO is responsible for doing the subtraction.
This commit is contained in:
Timothy Flynn 2022-01-14 17:33:54 -05:00 committed by Linus Groh
parent d93713b874
commit b2aa3c9f84
2 changed files with 4 additions and 6 deletions

View file

@ -106,7 +106,7 @@ static Value parse_simplified_iso8601(GlobalObject& global_object, const String&
// https://tc39.es/ecma262/#sec-date.parse:
// "When the UTC offset representation is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time."
if (!timezone.has_value() && hours.has_value())
time_ms += local_tza(time_ms, false);
time_ms = utc_time(time_ms);
if (timezone == '-')
time_ms += *timezone_hours * 3'600'000 + *timezone_minutes * 60'000;