Class: Playbook::PbTime::Time
- Inherits:
-
KitBase
- Object
- ViewComponent::Base
- KitBase
- Playbook::PbTime::Time
show all
- Defined in:
- app/pb_kits/playbook/pb_time/time.rb
Instance Method Summary
collapse
Methods inherited from KitBase
#object
Methods included from ZIndex
included
Methods included from Spacing
included, #max_width_options, #max_width_props, #max_width_values, #spacing_options, #spacing_props, #spacing_values
Methods included from Classnames
#generate_classname, #generate_classname_without_spacing, included
#initialize, #prop
#pb_rails
#pb_form_with
Instance Method Details
#classname ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 19
def classname
mutated_size = size
mutated_size = "sm" if mutated_size == "xs"
mutated_size = "md" if mutated_size == "lg"
generate_classname("pb_time_kit", align, mutated_size)
end
|
28
29
30
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 28
def format_time_string
"#{pb_date_time.to_hour}:#{pb_date_time.to_minutes}#{pb_date_time.to_meridian}"
end
|
32
33
34
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 32
def format_timezone_string
pb_date_time.to_timezone.to_s
end
|
#pb_date_time ⇒ Object
36
37
38
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 36
def pb_date_time
Playbook::PbKit::PbDateTime.new(time, timezone)
end
|