-
Notifications
You must be signed in to change notification settings - Fork 166
LG-14049 Fix barcode info alert dates and content #11398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1571,7 +1571,7 @@ step_indicator.status.complete: 完成了 | |
| step_indicator.status.current: 目前步骤 | ||
| step_indicator.status.not_complete: 未完成 | ||
| time.am: 上午 | ||
| time.formats.event_date: '%B %-d, %Y' | ||
| time.formats.event_date: '%Y年%B%-d日' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏🏻 |
||
| time.formats.event_time: '%-l:%M %p' | ||
| time.formats.event_timestamp: '%B %-d, %Y at %-l:%M %p' | ||
| time.formats.event_timestamp_js: '%{year}年%{month}月%{day}日, %{hour}:%{minute} %{day_period}' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,21 +23,33 @@ | |
| ) | ||
| end | ||
| subject(:presenter) { described_class.new(enrollment: enrollment) } | ||
| describe '#formatted_due_date' do | ||
| subject(:formatted_due_date) { presenter.formatted_due_date } | ||
|
|
||
| around do |example| | ||
| Time.use_zone('UTC') { example.run } | ||
| end | ||
|
|
||
| it 'returns a formatted due date' do | ||
| expect(formatted_due_date).to eq 'August 12, 2023' | ||
| describe '#formatted_due_date' do | ||
| let(:enrollment_established_at) { DateTime.new(2024, 7, 5) } | ||
|
|
||
| context 'when the enrollment has an enrollment_established_at time' do | ||
| [ | ||
| ['English', :en, 'August 3, 2024'], | ||
| ['Spanish', :es, '3 de agosto de 2024'], | ||
| ['French', :fr, '3 août 2024'], | ||
| ['Chinese', :zh, '2024年8月3日'], | ||
| ].each do |language, locale, expected| | ||
| context "when locale is #{language}" do | ||
| before do | ||
| I18n.locale = locale | ||
| end | ||
|
|
||
| it "returns the formatted due date in #{language}" do | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good test coverage. 👍🏻 |
||
| expect(presenter.formatted_due_date).to eq(expected) | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'there is no enrollment_established_at' do | ||
| context 'when the enrollment does not have an enrollment_established_at time' do | ||
| let(:enrollment_established_at) { nil } | ||
| it 'returns formatted due date when no enrollment_established_at' do | ||
| expect(formatted_due_date).to eq 'July 13, 2023' | ||
| expect(presenter.formatted_due_date).to eq 'July 13, 2023' | ||
| end | ||
| end | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,13 +31,25 @@ | |
| end | ||
|
|
||
| describe '#formatted_verified_date' do | ||
| around do |example| | ||
| Time.use_zone('UTC') { example.run } | ||
| before do | ||
| enrollment.update(status_updated_at: DateTime.new(2024, 7, 5)) | ||
| end | ||
|
|
||
| it 'returns a formatted verified date' do | ||
| enrollment.update(status_updated_at: status_updated_at) | ||
| expect(presenter.formatted_verified_date).to eq 'July 13, 2022' | ||
| [ | ||
| ['English', :en, 'July 4, 2024'], | ||
| ['Spanish', :es, '4 de julio de 2024'], | ||
| ['French', :fr, '4 juillet 2024'], | ||
| ['Chinese', :zh, '2024年7月4日'], | ||
| ].each do |language, locale, expected| | ||
| context "when locale is #{language}" do | ||
| before do | ||
| I18n.locale = locale | ||
| end | ||
|
|
||
| it "returns the formatted due date in #{language}" do | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 |
||
| expect(presenter.formatted_verified_date).to eq(expected) | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorta curious why this had to change from
strftimetoI18n.l, or was that more of a readability improvement / consistent change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That previous version wasn't displaying the months with the correct translated month name. The
I18n.lor localize method will correctly translate the month names when formatting the date.