Module: Jpcalendar::Format
- Included in:
- Jpcalendar
- Defined in:
- lib/jpcalendar/format.rb
Overview
出力用整形クラス
Instance Method Summary collapse
-
#calendar(_date = Date.today, options = {}) ⇒ Object
カレンダー出力 options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか start_with_monday 月曜ではじめるかどうか。 デフォルトはfalse @holiday_off trueの場合は休日を出力しない date_event 日付に対応するイベント情報(hash、またはjsonでparseできる文字列).
-
#calendar_div(_date = Date.today, options = {}) ⇒ Object
div版 options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか start_with_monday 月曜ではじめるかどうか。 デフォルトはfalse @holiday_off trueの場合は休日を出力しない date_event 日付に対応するイベント情報(hash、またはjsonでparseできる文字列).
-
#calendar_table(_date = Date.today, options = {}) ⇒ Object
テーブル版 options: padding 一桁の日付を何で埋めるか。デフォルトは0 => 01とか start_with_monday 月曜ではじめるかどうか。 デフォルトはfalse @holiday_off trueの場合は休日を出力しない date_event 日付に対応するイベント情報(hash、またはjsonでparseできる文字列).
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, = {}) print(_date, ) 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, = {}) .merge!(wrap_tag: :html, row_tag: :div, header_cell_tag: :span, body_cell_tag: :span) calendar(_date, ) 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, = {}) .merge!(wrap_tag: :table, row_tag: :tr, header_cell_tag: :th, body_cell_tag: :td) calendar(_date, ) end |