Class: Playbook::PbWeekdayStacked::WeekdayStacked

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::TagHelper, Playbook::Props
Defined in:
app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb

Instance Method Summary collapse

Methods included from Playbook::Props

#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values

Instance Method Details

#classnameObject



26
27
28
# File 'app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb', line 26

def classname
  generate_classname("pb_weekday_stacked_kit", align)
end

#day_of_weekObject



30
31
32
33
34
35
36
# File 'app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb', line 30

def day_of_week
  day = Playbook::PbKit::PbDateTime.new(date)
  formatted_day = compact ? day.to_day_of_week_compact : day.to_day_of_week
  (:time, datetime: day.to_iso) do
    formatted_day
  end
end

#formatted_month_and_dayObject



38
39
40
41
42
43
44
# File 'app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb', line 38

def formatted_month_and_day
  case variant
  when "day_only" then day
  when "expanded" then month_and_day(format: "%b %-d")
  else month_and_day
  end
end