Class: BootstrapCalendarRails::ViewHelpers::BootstrapCalendar

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap_calendar_rails/view_helper.rb

Constant Summary collapse

DAY_NAMES =
%w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday]
MOBILE_DAY_NAMES =
%w[Sun Mon Tues Wed Thur Fri Sat]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view, date, options = {}, callback) ⇒ BootstrapCalendar

you can pass some extra options in “options” parameter



28
29
30
31
32
33
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 28

def initialize(view, date, options = {}, callback)
  @view = view
  @date = date
  @options = options.symbolize_keys
  @callback = callback
end

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



17
18
19
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17

def callback
  @callback
end

#dateObject (readonly)

Returns the value of attribute date.



17
18
19
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17

def date
  @date
end

#optionsObject (readonly)

Returns the value of attribute options.



17
18
19
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17

def options
  @options
end

#viewObject (readonly)

Returns the value of attribute view.



17
18
19
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17

def view
  @view
end

Instance Method Details

#buildObject

build calendar



20
21
22
23
24
25
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 20

def build
  result =  :div, class: 'cal-month-box' do
    week_rows
  end
  header << result
end