mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
LibJS: Capture sub-second nanoseconds as a u64 in FormatTimeString
This is not a plain nanosecond value (which has a range of [0, 999]). Rather, it is all of the sub-second components added together.
This commit is contained in:
@@ -684,7 +684,7 @@ String format_fractional_seconds(u64 sub_second_nanoseconds, Precision precision
|
||||
}
|
||||
|
||||
// 13.25 FormatTimeString ( hour, minute, second, subSecondNanoseconds, precision [ , style ] ), https://tc39.es/proposal-temporal/#sec-temporal-formattimestring
|
||||
String format_time_string(u8 hour, u8 minute, u8 second, u16 sub_second_nanoseconds, SecondsStringPrecision::Precision precision, Optional<TimeStyle> style)
|
||||
String format_time_string(u8 hour, u8 minute, u8 second, u64 sub_second_nanoseconds, SecondsStringPrecision::Precision precision, Optional<TimeStyle> style)
|
||||
{
|
||||
// 1. If style is present and style is UNSEPARATED, let separator be the empty String; otherwise, let separator be ":".
|
||||
auto separator = style == TimeStyle::Unseparated ? ""sv : ":"sv;
|
||||
|
||||
Reference in New Issue
Block a user