Repository navigation
Improve Availability date on annual report - #5571
Conversation
The annual report shows a number of months until the current year's report is available. It's confusing because it shows the availability in months. In December, for example, it says it is 0 months until the report is available. We want to instead display the date when the report will be available -- which is the first day of the following year, i.e., January 1, 2027.
6442d24 to
20f4bf6
Compare
| <div class="row"> | ||
| <div class="col-md-12 mb-2"> | ||
| <h5 class="mb-1">Reports are available at the end of every year.</h5> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{pluralize(@month_remaining_to_report, 'month')})" %> </span> |
There was a problem hiding this comment.
You can remove the @month_remaining_to_report instance variable now.
| <div class="col-md-12 mb-2"> | ||
| <h5 class="mb-1">Reports are available at the end of every year.</h5> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{pluralize(@month_remaining_to_report, 'month')})" %> </span> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{available_date})" %> </span> |
There was a problem hiding this comment.
This should be "available on", not "available in".
| RSpec.describe Reports::AnnualReportsHelper, type: :helper do | ||
| describe "#available_date" do | ||
| it "returns the first day of the following year with a custom date format" do | ||
| travel_to Time.zone.local(2026, 0o1, 0o1) |
There was a problem hiding this comment.
Probably should have a few edge cases here. I'd probably use
- Jan 1
- Dec 31
- Some time in between
There was a problem hiding this comment.
Good idea! The original test was for January 1st, so I added coverage for Dec 31 and a date during the year in ab6799a
| expect(response).to have_http_status(:success) | ||
| end | ||
|
|
||
| it "displays the first day of the following year as the date when the report will be available" do |
There was a problem hiding this comment.
I'd make this explicit, i.e. use travel_to and check the actual date rather than just re-typing the code used.
|
Passes tech review. Over to @ruestitch @janeewheatley for QA. |
|
@stefannibrasil: Your PR |

Resolves #5570
Description
The annual report shows a number of months until the current year's report is available:
But it's confusing depending on when this page is accessed. In December, for example, it says it is 0 months until the report is available:
We want to instead display the date when the report will be available -- which is the first day of the following year, i.e., January 1, 2027.
Type of change
How Has This Been Tested?
Screenshots
How it looks now: