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

LibJS: Add Temporal.Instant.prototype.round()

As well as the required Abstract Operations.
This commit is contained in:
Idan Horowitz 2021-07-11 23:49:05 +03:00 committed by Linus Groh
parent 75d1ffea00
commit 84b028bd71
7 changed files with 361 additions and 1 deletions

View file

@ -19,7 +19,10 @@ enum class OptionType {
Number
};
Value get_option(GlobalObject&, Object& options, String const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback);
String to_temporal_rounding_mode(GlobalObject&, Object& normalized_options, String const& fallback);
u64 to_temporal_rounding_increment(GlobalObject&, Object& normalized_options, Optional<double> dividend, bool inclusive);
Optional<String> to_smallest_temporal_unit(GlobalObject&, Object& normalized_options, Vector<StringView> const& disallowed_units, Optional<String> fallback);
BigInt* round_number_to_increment(GlobalObject&, BigInt const&, u64 increment, String const& rounding_mode);
struct ISODateTime {
i32 year;
i32 month;