Class: PhlexKit::Calendar
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Calendar
- Defined in:
- app/components/phlex_kit/calendar/calendar.rb
Overview
Calendar (month grid with day selection), ported from ruby_ui's RubyUI::Calendar. Renders the header (title + prev/next), the
11 12 13 14 15 16 17 |
# File 'app/components/phlex_kit/calendar/calendar.rb', line 11 def initialize(selected_date: nil, min_date: nil, input_id: nil, date_format: "yyyy-MM-dd", **attrs) @selected_date = selected_date @min_date = min_date @input_id = input_id @date_format = date_format @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/components/phlex_kit/calendar/calendar.rb', line 19 def view_template div(**mix(calendar_attrs, @attrs)) do render CalendarHeader.new do render CalendarTitle.new render CalendarPrev.new render CalendarNext.new end render CalendarBody.new # Where the calendar is rendered (Weekdays and Days) render CalendarWeekdays.new # Template for the weekdays render CalendarDays.new # Templates for the day states end end |