diff --git a/intl/locale/DateTimeFormat.cpp b/intl/locale/DateTimeFormat.cpp index 162a3d4d5ac8..45fa9c9a9f6b 100644 --- a/intl/locale/DateTimeFormat.cpp +++ b/intl/locale/DateTimeFormat.cpp @@ -81,6 +81,12 @@ nsresult DateTimeFormat::FormatDateTime( case Skeleton::yyyyMMMM: skeleton.AssignASCII("yyyyMMMM"); break; + case Skeleton::E: + skeleton.AssignASCII("E"); + break; + case Skeleton::EEEE: + skeleton.AssignASCII("EEEE"); + break; default: MOZ_ASSERT_UNREACHABLE("Unhandled skeleton enum"); } diff --git a/intl/locale/DateTimeFormat.h b/intl/locale/DateTimeFormat.h index 5d9a77529d8a..6e675b36a995 100644 --- a/intl/locale/DateTimeFormat.h +++ b/intl/locale/DateTimeFormat.h @@ -37,7 +37,8 @@ class DateTimeFormat { enum class Style { Wide, Abbreviated }; - enum class Skeleton { yyyyMM, yyyyMMMM }; + // Weekday (E, EEEE) only used in Thunderbird. + enum class Skeleton { yyyyMM, yyyyMMMM, E, EEEE }; // performs a locale sensitive date formatting operation on the PRTime // parameter diff --git a/intl/locale/tests/gtest/TestDateTimeFormat.cpp b/intl/locale/tests/gtest/TestDateTimeFormat.cpp index e2e56014cfb3..06b2810e7bc9 100644 --- a/intl/locale/tests/gtest/TestDateTimeFormat.cpp +++ b/intl/locale/tests/gtest/TestDateTimeFormat.cpp @@ -223,6 +223,16 @@ TEST(DateTimeFormat, DateFormatSelectorsForeign) ASSERT_TRUE(NS_SUCCEEDED(rv)); ASSERT_STREQ("Januar 1970", NS_ConvertUTF16toUTF8(formattedTime).get()); + rv = mozilla::DateTimeFormat::FormatDateTime( + &prExplodedTime, DateTimeFormat::Skeleton::E, formattedTime); + ASSERT_TRUE(NS_SUCCEEDED(rv)); + ASSERT_STREQ("Do", NS_ConvertUTF16toUTF8(formattedTime).get()); + + rv = mozilla::DateTimeFormat::FormatDateTime( + &prExplodedTime, DateTimeFormat::Skeleton::EEEE, formattedTime); + ASSERT_TRUE(NS_SUCCEEDED(rv)); + ASSERT_STREQ("Donnerstag", NS_ConvertUTF16toUTF8(formattedTime).get()); + rv = mozilla::DateTimeFormat::GetCalendarSymbol( mozilla::DateTimeFormat::Field::Month, mozilla::DateTimeFormat::Style::Wide, &prExplodedTime, formattedTime);