Simplify data structure

This commit is contained in:
2024-10-23 22:36:20 +02:00
parent b54adcab74
commit 278e151eef
2 changed files with 11 additions and 18 deletions

View File

@@ -19,7 +19,6 @@ defmodule Mihainator.Extractor do
date_range = Date.range(first_date, last_date)
interaction_data =
raw_data
|> Enum.filter(fn {date, _} -> Date.after?(date, first_date) end)
|> Map.new()
@@ -31,12 +30,6 @@ defmodule Mihainator.Extractor do
"#{date.year}-#{month}"
end)
%{
first_date: first_date,
last_date: last_date,
interaction_data: interaction_data
}
end
defp get_raw_data(file) do

View File

@@ -2,7 +2,7 @@
<p class="text-lg">This is the result of your history:</p>
<div class="calendar-wrapper">
<%= for {_, days_of_month} <- @calendar_dates.interaction_data do %>
<%= for {_, days_of_month} <- @calendar_dates do %>
<div class="calendar">
<.month days_of_month={days_of_month}></.month>