diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index e2661d0ba..96f3f7c17 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -287,6 +287,7 @@ class ReportsController < ApplicationController trends << { month: month_start.strftime("%b %Y"), + is_current_month: (month_start.month == Date.current.month && month_start.year == Date.current.year), income: income, expenses: expenses, net: income - expenses diff --git a/app/views/reports/_trends_insights.html.erb b/app/views/reports/_trends_insights.html.erb index 6b294cc9c..0a02928c4 100644 --- a/app/views/reports/_trends_insights.html.erb +++ b/app/views/reports/_trends_insights.html.erb @@ -18,11 +18,11 @@ - <% trends_data.each_with_index do |trend, index| %> - "> + <% trends_data.each do |trend| %> + "> <%= trend[:month] %> - <% if index == trends_data.length - 1 %> + <% if trend[:is_current_month] %> (<%= t("reports.trends.current") %>) <% end %>