2024-11-20 12:59:15 -05:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
|
|
|
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
|
|
|
|
|
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-11-22 18:38:53 -05:00
|
|
|
#include <LibCrypto/BigFraction/BigFraction.h>
|
2024-11-22 18:16:57 -05:00
|
|
|
#include <LibJS/Runtime/Temporal/AbstractOperations.h>
|
2024-11-22 16:39:21 -05:00
|
|
|
#include <LibJS/Runtime/Temporal/ISORecords.h>
|
2024-11-20 12:59:15 -05:00
|
|
|
|
|
|
|
|
namespace JS::Temporal {
|
|
|
|
|
|
|
|
|
|
ISODateTime combine_iso_date_and_time_record(ISODate, Time);
|
|
|
|
|
bool iso_date_time_within_limits(ISODateTime);
|
2024-11-22 17:18:38 -05:00
|
|
|
ThrowCompletionOr<ISODateTime> interpret_temporal_date_time_fields(VM&, StringView calendar, CalendarFields&, Overflow);
|
2024-11-21 13:21:29 -05:00
|
|
|
ISODateTime balance_iso_date_time(double year, double month, double day, double hour, double minute, double second, double millisecond, double microsecond, double nanosecond);
|
2024-11-22 18:16:57 -05:00
|
|
|
i8 compare_iso_date_time(ISODateTime const&, ISODateTime const&);
|
|
|
|
|
ThrowCompletionOr<InternalDuration> difference_iso_date_time(VM&, ISODateTime const&, ISODateTime const&, StringView calendar, Unit largest_unit);
|
|
|
|
|
ThrowCompletionOr<InternalDuration> difference_plain_date_time_with_rounding(VM&, ISODateTime const&, ISODateTime const&, StringView calendar, Unit largest_unit, u64 rounding_increment, Unit smallest_unit, RoundingMode);
|
2024-11-22 18:38:53 -05:00
|
|
|
ThrowCompletionOr<Crypto::BigFraction> difference_plain_date_time_with_total(VM&, ISODateTime const&, ISODateTime const&, StringView calendar, Unit);
|
2024-11-20 12:59:15 -05:00
|
|
|
|
|
|
|
|
}
|