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

LibJS: Move time conversion constants to the Date header

These are needed outside of the Date object .cpp file, so move them to
the header.
This commit is contained in:
Timothy Flynn 2022-01-15 00:54:07 -05:00 committed by Linus Groh
parent 34a1dd4257
commit 11d7c7ebbd
2 changed files with 27 additions and 27 deletions

View file

@ -26,6 +26,21 @@ public:
String iso_date_string() const;
// https://tc39.es/ecma262/#eqn-HoursPerDay
static constexpr double hours_per_day = 24;
// https://tc39.es/ecma262/#eqn-MinutesPerHour
static constexpr double minutes_per_hour = 60;
// https://tc39.es/ecma262/#eqn-SecondsPerMinute
static constexpr double seconds_per_minute = 60;
// https://tc39.es/ecma262/#eqn-msPerSecond
static constexpr double ms_per_second = 1'000;
// https://tc39.es/ecma262/#eqn-msPerMinute
static constexpr double ms_per_minute = 60'000;
// https://tc39.es/ecma262/#eqn-msPerHour
static constexpr double ms_per_hour = 3'600'000;
// https://tc39.es/ecma262/#eqn-msPerDay
static constexpr double ms_per_day = 86'400'000;
private:
double m_date_value { 0 }; // [[DateValue]]
};