mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-17 06:21:55 +00:00
Everywhere: Replace DateTime::to_string() with UnixDateTime::to_string()
Replace LibCore::DateTime::to_string() with AK::UnixDateTime::to_string(). Remove unncessary #include <LibCore/DateTime.h>.
This commit is contained in:
parent
8f8e51b1fc
commit
6fb2be96bf
Notes:
github-actions[bot]
2025-06-20 00:44:11 +00:00
Author: https://github.com/tomaszstrejczek
Commit: 6fb2be96bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5096
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/gmta
13 changed files with 25 additions and 30 deletions
|
@ -11,7 +11,6 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibJS/Runtime/Date.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
#include <LibJS/Runtime/RegExpObject.h>
|
||||
|
@ -2326,8 +2325,8 @@ static String convert_number_to_date_string(double input)
|
|||
// The algorithm to convert a number to a string, given a number input, is as follows: Return a valid
|
||||
// date string that represents the date that, in UTC, is current input milliseconds after midnight UTC
|
||||
// on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0Z").
|
||||
auto date = Core::DateTime::from_timestamp(input / 1000.);
|
||||
return MUST(date.to_string("%Y-%m-%d"sv, Core::DateTime::LocalTime::No));
|
||||
auto date = AK::UnixDateTime::from_seconds_since_epoch(input / 1000.);
|
||||
return MUST(date.to_string("%Y-%m-%d"sv));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#time-state-(type=time):concept-input-value-number-string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue