mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS: Don't use Temporal to parse UTC offset strings
The production for these strings has been removed from Temporal. This implements a separate parser in accordance with the Date spec.
This commit is contained in:
parent
f88826691c
commit
dd6acfecd4
Notes:
github-actions[bot]
2024-11-18 22:47:54 +00:00
Author: https://github.com/trflynn89
Commit: dd6acfecd4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2387
3 changed files with 192 additions and 40 deletions
|
@ -58,6 +58,14 @@ constexpr inline double ms_per_day = 86'400'000;
|
|||
constexpr inline double ns_per_day = 86'400'000'000'000;
|
||||
extern Crypto::SignedBigInteger const ns_per_day_bigint;
|
||||
|
||||
struct UTCOffset {
|
||||
Optional<char> sign;
|
||||
Optional<u8> hour;
|
||||
Optional<u8> minute;
|
||||
Optional<u8> second;
|
||||
Optional<StringView> fraction;
|
||||
};
|
||||
|
||||
double day(double);
|
||||
double time_within_day(double);
|
||||
u16 days_in_year(i32);
|
||||
|
@ -85,6 +93,7 @@ double make_time(double hour, double min, double sec, double ms);
|
|||
double make_day(double year, double month, double date);
|
||||
double make_date(double day, double time);
|
||||
double time_clip(double time);
|
||||
Optional<UTCOffset> parse_utc_offset(StringView);
|
||||
bool is_time_zone_offset_string(StringView offset_string);
|
||||
double parse_time_zone_offset_string(StringView offset_string);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue