Class: Clot::DatetimeSelect

Inherits:
ModelMultiDateTag show all
Defined in:
lib/clot/model_date_tags.rb

Instance Method Summary collapse

Methods inherited from ModelMultiDateTag

#fill_zeros, #get_unit_order, #set_unit

Methods included from ModelTag

#render, #set_primary_attributes

Methods inherited from MultiDateTag

#personal_attributes, #render, #render_units, #set_primary_attributes, #set_unit, #time_unit

Methods inherited from ClotTag

#initialize, #render

Methods included from TagHelper

#resolve_value, #split_params

Methods included from AttributeSetter

#personal_attributes, #set_attributes, #set_primary_attributes

Constructor Details

This class inherits a constructor from Clot::ClotTag

Instance Method Details

#render_nested(context) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/clot/model_date_tags.rb', line 72

def render_nested(context)
  @time = @value_string || Time.zone.now
  date_units =  ['year', 'month', 'day']
  time_units = ["hour", "minute"]
  time_result = render_units(time_units, context, @time_separator)
  date_result = render_units(date_units, context, @date_separator)
  date_result + @datetime_separator.to_s + time_result
end