Module: Jpcalendar::Format

Included in:
Jpcalendar
Defined in:
lib/jpcalendar/format.rb

Overview

出力用整形クラス

Instance Method Summary collapse

Instance Method Details

#calendar(_date = Date.today, options = {}) ⇒ Object

カレンダー出力options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか

start_with_monday 


43
44
45
# File 'lib/jpcalendar/format.rb', line 43

def calendar(_date = Date.today,options = {})
  print(_date, options)
end

#calendar_div(_date = Date.today, options = {}) ⇒ Object

div版options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか

start_with_monday 


31
32
33
34
# File 'lib/jpcalendar/format.rb', line 31

def calendar_div(_date = Date.today,options = {})
  options.merge!(wrap_tag: :html, row_tag: :div, header_cell_tag: :span, body_cell_tag: :span)
  calendar(_date, options)
end

#calendar_table(_date = Date.today, options = {}) ⇒ Object

テーブル版options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか

start_with_monday 


19
20
21
22
# File 'lib/jpcalendar/format.rb', line 19

def calendar_table(_date = Date.today,options = {})
  options.merge!(wrap_tag: :table, row_tag: :tr, header_cell_tag: :th, body_cell_tag: :td)
  calendar(_date, options)
end