Class: DaisyUI::Calendar

Inherits:
Base
  • Object
show all
Defined in:
lib/daisy_ui/calendar.rb

Overview

Supports Cally web component and Pikaday date picker

Constant Summary

Constants inherited from Base

Base::BOOLS, Base::COLOR_MODIFIERS

Instance Method Summary collapse

Methods inherited from Base

inherited, register_modifiers

Constructor Details

#initialize(type: :cally) ⇒ Calendar

Returns a new instance of Calendar.



13
14
15
16
# File 'lib/daisy_ui/calendar.rb', line 13

def initialize(*, type: :cally, **)
  super(*, **)
  @type = type
end

Instance Method Details

#view_templateObject



18
19
20
21
22
23
24
25
# File 'lib/daisy_ui/calendar.rb', line 18

def view_template(&)
  case type
  when :cally
    render_cally(&)
  when :pikaday
    render_pikaday
  end
end