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

LibJS: Replace magic nanosecond numbers with constants

This is an editorial change in the Temporal spec.

See: 3fdbfda
This commit is contained in:
Linus Groh 2022-05-06 19:28:56 +02:00
parent 3729a910f6
commit c6f7214a60
9 changed files with 45 additions and 36 deletions

View file

@ -44,6 +44,9 @@ constexpr double ms_per_minute = 60'000;
constexpr double ms_per_hour = 3'600'000;
// https://tc39.es/ecma262/#eqn-msPerDay
constexpr double ms_per_day = 86'400'000;
// https://tc39.es/proposal-temporal/#eqn-nsPerDay
constexpr double ns_per_day = 86'400'000'000'000;
static auto const ns_per_day_bigint = "86400000000000"_sbigint;
u16 day_within_year(double);
u8 date_from_time(double);