summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-11-30 21:23:13 -0500
committerLinus Groh <mail@linusgroh.de>2021-12-01 16:36:26 +0000
commitbf79c731583d3d887b23fb9d9ef5fde9af35a9e1 (patch)
treeedd66315d3090f8c0548757ecb566276399a5101 /Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp
parentf02ecc1da29f45af98f485a05db49e31f4c941d2 (diff)
downloadserenity-bf79c731583d3d887b23fb9d9ef5fde9af35a9e1.zip
LibUnicode: Do not generate data for "generic" calendars
This is not a calendar supported by ECMA-402, so let's not waste space with its data. Further, don't generate "gregorian" as a valid Unicode locale extension keyword. It's an invalid type identifier, thus cannot be used in locales such as "en-u-ca-gregorian".
Diffstat (limited to 'Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp
index 89ed709092..607993d790 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp
@@ -151,6 +151,11 @@ static ErrorOr<void> parse_calendars(String locale_calendars_path, UnicodeLocale
};
calendars_object.as_object().for_each_member([&](auto const& calendar_name, JsonValue const& value) {
+ // The generic calendar is not a supported Unicode calendar key, so skip it:
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar#unicode_calendar_keys
+ if (calendar_name == "generic"sv)
+ return;
+
auto& calendar = ensure_calendar(calendar_name);
if (!locale_data.calendars.contains_slow(calendar_name))