<% @report.each do |month, groups| %> <% is_current_month = month.month == Date.today.month && month.year == Date.today.year %> <% total_minutes = groups.values.map { |data| (data[:hours].to_i * 60 + data[:minutes].to_i) }.sum %> <% total_hours = total_minutes / 60 %> <% total_rest_minutes = total_minutes % 60 %>
<%= month.strftime("%B %Y") %> <% if is_current_month %> 🌟 Aktuell <% end %>
<% groups.each_with_index do |((typ, art), data), index| %> <% if index == 0 %> <% end %> <% end %>
📌 Typ 📂 Art ⏱️ Zeit 🧮 Monats-Gesamt
<%= typ.capitalize %> <%= art %> <%= data[:hours] %>h <%= data[:minutes] %>min <%= total_hours %>h <%= total_rest_minutes %>min
<% end %>