+
+ <%= for day <- ~w(Sun Mon Tue Wed Thu Fri Sat) do %>
+
{day}
+ <% end %>
+
+
+ <%= for _ <- 1..(Date.day_of_week(@current_month) - 1) do %>
+
+ <% end %>
+
+
+ <%= for day <- 1..Date.days_in_month(@current_month) do %>
+ <% {:ok, date}=Date.new(@current_month.year, @current_month.month, day) %>
+
+
+
{day}
+
+
+
+ <% IO.puts("Date: #{date}") %>
+ <% IO.inspect(Map.get(@events, date)) %>
+ <%= case Map.get(@events, date) do %>
+ <% nil -> %>
+
+ <% events -> %>
+
+ <%= for event <- events do %>
+ - {event.subject}
+ <% end %>
+
+ <% end %>
+
+ <% end %>
+