diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f3575fe94..d6cce44e7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -22,11 +22,13 @@ def organization_abbreviation_dropdown_options end def us_timezones - us_timezones = ActiveSupport::TimeZone["Eastern Time (US & Canada)"], + [ + ActiveSupport::TimeZone["Eastern Time (US & Canada)"], ActiveSupport::TimeZone["Central Time (US & Canada)"], ActiveSupport::TimeZone["Mountain Time (US & Canada)"], ActiveSupport::TimeZone["Pacific Time (US & Canada)"], ActiveSupport::TimeZone["Hawaii"] + ] end def hisp_questions_key diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index 26faf8711..5e0136468 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -9,6 +9,7 @@ en-US: - Fri - Sat abbr_month_names: + - - Jan - Feb - Mar @@ -34,6 +35,7 @@ en-US: long: "%B %d, %Y" short: "%b %d" month_names: + - - January - February - March diff --git a/config/locales/en.yml b/config/locales/en.yml index c0b39c18f..9b7ab8b32 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,6 +56,7 @@ en-US: pm: pm date: abbr_month_names: + - - Jan - Feb - Mar @@ -69,6 +70,7 @@ en-US: - Nov - Dec month_names: + - - January - February - March diff --git a/config/locales/es.yml b/config/locales/es.yml index 425ff3e07..5a4771267 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -67,6 +67,7 @@ es: - vie - sáb abbr_month_names: + - - ene - feb - mar @@ -93,6 +94,7 @@ es: with_timezone: "%-d de %B de %Y (UTC%:z)" short: "%-d de %b" month_names: + - - enero - febrero - marzo diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 200f6e500..0395aa46c 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -87,6 +87,7 @@ zh-CN: - 周五 - 周六 abbr_month_names: + - - 1月 - 2月 - 3月 @@ -113,6 +114,7 @@ zh-CN: with_timezone: "%Y年%m月%d日 (%:z)" short: "%m月%d日" month_names: + - - 一月 - 二月 - 三月 diff --git a/spec/features/admin/forms_spec.rb b/spec/features/admin/forms_spec.rb index d8827c6e4..e3ef9f519 100644 --- a/spec/features/admin/forms_spec.rb +++ b/spec/features/admin/forms_spec.rb @@ -756,6 +756,7 @@ describe 'editing form timezone' do let!(:form_with_responses) { FactoryBot.create(:form, :single_question, :with_responses, organization:) } + let!(:additional_response) { FactoryBot.create(:submission, form: form_with_responses, answer_01: "hi", created_at: "2025-01-02") } let!(:user_role) { FactoryBot.create(:user_role, :form_manager, user: admin, form: form_with_responses) } before do @@ -764,9 +765,14 @@ expect(page).to have_content('Form Manager forms options updated successfully') end - it 'can view submissions with a form time_zone' do + it 'renders valid time' do visit responses_admin_form_path(form_with_responses) - expect(page.all("#submissions_table .usa-table.submissions tbody tr").size).to eq(3) + expect(page.all("#submissions_table .usa-table.submissions tbody tr").size).to eq(4) + end + + it 'ensure format_time translation is correct' do + visit responses_admin_form_path(form_with_responses) + expect(all("#submissions_table .usa-table.submissions tbody tr").last).to have_content("January 01, 2025") end end