Skip to content

Commit

Permalink
Fix Intl to clear needDefault flag correctly (#1014)
Browse files Browse the repository at this point in the history
Summary:
Similar to year, month, and day, specifying "weekday" as an option to
`toLocaleString` should result in only the weekday being printed. To
force this, use the `kDateRequired` bit as we do for the other fields.

Pull Request resolved: #1014

Test Plan: Added a test in the next diff.

Reviewed By: tmikov

Differential Revision: D49856174

Pulled By: neildhar

fbshipit-source-id: ed52f425e4240f672931d236bc53cc58724b6747
  • Loading branch information
Maturia authored and facebook-github-bot committed Oct 4, 2023
1 parent 329430e commit 64daca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/VM/JSLib/Intl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ constexpr OptionData kDTFOptions[] = {
{u"hourCycle", platform_intl::Option::Kind::String, 0},
{u"timeZone", platform_intl::Option::Kind::String, 0},
{u"formatMatcher", platform_intl::Option::Kind::String, 0},
{u"weekday", platform_intl::Option::Kind::String, 0},
{u"weekday", platform_intl::Option::Kind::String, kDateRequired},
{u"era", platform_intl::Option::Kind::String, 0},
{u"year",
platform_intl::Option::Kind::String,
Expand Down

0 comments on commit 64daca6

Please sign in to comment.