Simplify data structure
This commit is contained in:
@@ -19,7 +19,6 @@ defmodule Mihainator.Extractor do
|
|||||||
|
|
||||||
date_range = Date.range(first_date, last_date)
|
date_range = Date.range(first_date, last_date)
|
||||||
|
|
||||||
interaction_data =
|
|
||||||
raw_data
|
raw_data
|
||||||
|> Enum.filter(fn {date, _} -> Date.after?(date, first_date) end)
|
|> Enum.filter(fn {date, _} -> Date.after?(date, first_date) end)
|
||||||
|> Map.new()
|
|> Map.new()
|
||||||
@@ -31,12 +30,6 @@ defmodule Mihainator.Extractor do
|
|||||||
|
|
||||||
"#{date.year}-#{month}"
|
"#{date.year}-#{month}"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
%{
|
|
||||||
first_date: first_date,
|
|
||||||
last_date: last_date,
|
|
||||||
interaction_data: interaction_data
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_raw_data(file) do
|
defp get_raw_data(file) do
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<p class="text-lg">This is the result of your history:</p>
|
<p class="text-lg">This is the result of your history:</p>
|
||||||
|
|
||||||
<div class="calendar-wrapper">
|
<div class="calendar-wrapper">
|
||||||
<%= for {_, days_of_month} <- @calendar_dates.interaction_data do %>
|
<%= for {_, days_of_month} <- @calendar_dates do %>
|
||||||
<div class="calendar">
|
<div class="calendar">
|
||||||
<.month days_of_month={days_of_month}></.month>
|
<.month days_of_month={days_of_month}></.month>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user