File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,21 @@ defmodule ComponentsGuideWeb.CalendarComponent do
22 use ComponentsGuideWeb , :component
33
44 def calendar_grid ( assigns ) do
5- % { year: year , month: month , day: day } = today = assigns [ :date ]
6- start_date = Date . beginning_of_month ( today )
7- end_date = Date . end_of_month ( today )
5+ % { year: year , month: month } = assigns
6+
7+ day =
8+ case assigns [ :current_date ] do
9+ nil ->
10+ nil
11+
12+ % { day: day } ->
13+ day
14+ end
15+
16+ # %{year: year, month: month, day: day} = today = assigns[:date]
17+ date = Date . new! ( year , month , 1 )
18+ start_date = Date . beginning_of_month ( date )
19+ end_date = Date . end_of_month ( date )
820 date_range = Date . range ( start_date , end_date )
921
1022 day_inset = Date . day_of_week ( start_date )
Original file line number Diff line number Diff line change 11< div class = "prose md:prose-xl prose-invert max-w-6xl mx-auto pt-8 px-3 " >
22 < h1 class = "text-center " > Developer Calendar</ h1 >
3- < CalendarComponent . calendar_grid date = { @ today } extra = { @ calendar_extra } />
3+ < CalendarComponent . calendar_grid year = { @ today . year } month = { @ today . month } current_date = { @ today } extra = { @ calendar_extra } />
44</ div >
55
66< div class = "prose md:prose-xl prose-invert max-w-2xl mx-auto pt-8 pb-16 px-3 " >
You can’t perform that action at this time.
0 commit comments