mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +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:
parent
34a1dd4257
commit
11d7c7ebbd
Notes:
sideshowbarker
2024-07-17 20:50:41 +09:00
Author: https://github.com/trflynn89
Commit: 11d7c7ebbd
Pull-request: https://github.com/SerenityOS/serenity/pull/11913
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/nico
2 changed files with 27 additions and 27 deletions
|
@ -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]]
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue