mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09: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:
parent
0b59971ef9
commit
7f3de3be9c
Notes:
github-actions[bot]
2024-11-24 00:38:15 +00:00
Author: https://github.com/trflynn89
Commit: 7f3de3be9c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2535
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue