mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibJS+LibUnicode: Port Intl.DateTimeFormat to UTF-16 strings
This commit is contained in:
committed by
Andreas Kling
parent
b2f053e783
commit
ee01f857d1
Notes:
github-actions[bot]
2025-07-24 08:41:42 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/ee01f857d1b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5581
@@ -119,11 +119,11 @@ ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_tim
|
||||
|
||||
// 11.5.7 FormatDateTime ( dateTimeFormat, x ), https://tc39.es/ecma402/#sec-formatdatetime
|
||||
// 15.9.6 FormatDateTime ( dateTimeFormat, x ), https://tc39.es/proposal-temporal/#sec-formatdatetime
|
||||
ThrowCompletionOr<String> format_date_time(VM& vm, DateTimeFormat& date_time_format, FormattableDateTime const& time)
|
||||
ThrowCompletionOr<Utf16String> format_date_time(VM& vm, DateTimeFormat& date_time_format, FormattableDateTime const& time)
|
||||
{
|
||||
// 1. Let parts be ? PartitionDateTimePattern(dateTimeFormat, x).
|
||||
// 2. Let result be the empty String.
|
||||
String result;
|
||||
Utf16String result;
|
||||
|
||||
// NOTE: We short-circuit PartitionDateTimePattern as we do not need individual partitions.
|
||||
{
|
||||
@@ -196,11 +196,11 @@ ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_tim
|
||||
|
||||
// 11.5.10 FormatDateTimeRange ( dateTimeFormat, x, y ), https://tc39.es/ecma402/#sec-formatdatetimerange
|
||||
// 15.9.9 FormatDateTimeRange ( dateTimeFormat, x, y ), https://tc39.es/proposal-temporal/#sec-formatdatetimerange
|
||||
ThrowCompletionOr<String> format_date_time_range(VM& vm, DateTimeFormat& date_time_format, FormattableDateTime const& start, FormattableDateTime const& end)
|
||||
ThrowCompletionOr<Utf16String> format_date_time_range(VM& vm, DateTimeFormat& date_time_format, FormattableDateTime const& start, FormattableDateTime const& end)
|
||||
{
|
||||
// 1. Let parts be ? PartitionDateTimeRangePattern(dateTimeFormat, x, y).
|
||||
// 2. Let result be the empty String.
|
||||
String result;
|
||||
Utf16String result;
|
||||
|
||||
// NOTE: We short-circuit PartitionDateTimeRangePattern as we do not need individual partitions.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user