Class: RubyUI::Calendar
- Defined in:
- lib/ruby_ui/calendar/calendar.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(selected_date: nil, input_id: nil, date_format: "yyyy-MM-dd", **attrs) ⇒ Calendar
constructor
A new instance of Calendar.
- #view_template ⇒ Object
Constructor Details
#initialize(selected_date: nil, input_id: nil, date_format: "yyyy-MM-dd", **attrs) ⇒ Calendar
Returns a new instance of Calendar.
5 6 7 8 9 10 |
# File 'lib/ruby_ui/calendar/calendar.rb', line 5 def initialize(selected_date: nil, input_id: nil, date_format: "yyyy-MM-dd", **attrs) @selected_date = selected_date @input_id = input_id @date_format = date_format super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_ui/calendar/calendar.rb', line 12 def view_template div(**attrs) do RubyUI.CalendarHeader do RubyUI.CalendarTitle RubyUI.CalendarPrev RubyUI.CalendarNext end RubyUI.CalendarBody # Where the calendar is rendered (Weekdays and Days) RubyUI.CalendarWeekdays # Template for the weekdays RubyUI.CalendarDays # Template for the days end end |