From ab2949e59d6c9c6a366f83b7115d83dd840d17a6 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Wed, 29 Nov 2023 11:04:35 +0100 Subject: [PATCH] Fix allowed_values for month attribute of Primer::Beta::RelativeTime --- .changeset/new-lamps-poke.md | 5 +++++ app/components/primer/beta/relative_time.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/new-lamps-poke.md diff --git a/.changeset/new-lamps-poke.md b/.changeset/new-lamps-poke.md new file mode 100644 index 0000000000..c26bf263e7 --- /dev/null +++ b/.changeset/new-lamps-poke.md @@ -0,0 +1,5 @@ +--- +'@primer/view-components': patch +--- + +Fix: Allow month attribute for Primer::Beta::RelativeTime diff --git a/app/components/primer/beta/relative_time.rb b/app/components/primer/beta/relative_time.rb index 65c1411f56..a511619fff 100644 --- a/app/components/primer/beta/relative_time.rb +++ b/app/components/primer/beta/relative_time.rb @@ -131,7 +131,7 @@ def initialize( @system_arguments[:hour] = fetch_or_fallback(HOUR_OPTIONS, hour, HOUR_DEFAULT) if hour.present? @system_arguments[:weekday] = fetch_or_fallback(WEEKDAY_OPTIONS, weekday, WEEKDAY_DEFAULT) if weekday.present? @system_arguments[:day] = fetch_or_fallback(DAY_OPTIONS, day, DAY_DEFAULT) if day.present? - @system_arguments[:month] = fetch_or_fallback(MONTH_DEFAULT, month, MONTH_DEFAULT) if month.present? + @system_arguments[:month] = fetch_or_fallback(MONTH_OPTIONS, month, MONTH_DEFAULT) if month.present? @system_arguments[:year] = fetch_or_fallback(YEAR_OPTIONS, year, YEAR_DEFAULT) if year.present? @system_arguments[:"time-zone-name"] = fetch_or_fallback(TIMEZONENAME_OPTIONS, time_zone_name, TIMEZONENAME_DEFAULT) if time_zone_name.present? @system_arguments[:threshold] = threshold if threshold.present?