mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +00:00
This also includes a stubbed Temporal.Duration.prototype. Until we have re-implemented Temporal.PlainDate/ZonedDateTime, some of Temporal.Duration.compare (and its invoked AOs) are left unimplemented.
36 lines
881 B
C++
36 lines
881 B
C++
/*
|
|
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
|
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <AK/StringView.h>
|
|
|
|
namespace JS::Temporal {
|
|
|
|
struct ParseResult {
|
|
Optional<char> sign;
|
|
Optional<StringView> duration_years;
|
|
Optional<StringView> duration_months;
|
|
Optional<StringView> duration_weeks;
|
|
Optional<StringView> duration_days;
|
|
Optional<StringView> duration_hours;
|
|
Optional<StringView> duration_hours_fraction;
|
|
Optional<StringView> duration_minutes;
|
|
Optional<StringView> duration_minutes_fraction;
|
|
Optional<StringView> duration_seconds;
|
|
Optional<StringView> duration_seconds_fraction;
|
|
};
|
|
|
|
enum class Production {
|
|
TemporalDurationString,
|
|
};
|
|
|
|
Optional<ParseResult> parse_iso8601(Production, StringView);
|
|
|
|
}
|