70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/active_scaffold/bridges/shared/date_bridge.rb', line 70
def active_scaffold_human_condition_date_bridge(column, value)
case value[:opt]
when 'RANGE'
range_type, range = value[:range].downcase.split('_')
format = active_scaffold_human_condition_date_bridge_range_format(range_type, range)
from, to = controller.class.date_bridge_from_to(column, value)
"#{column.active_record_class.human_attribute_name(column.name)} = #{as_(value[:range].downcase).downcase} (#{I18n.l(from, :format => format)})"
when 'PAST', 'FUTURE'
from, to = controller.class.date_bridge_from_to(column, value)
"#{column.active_record_class.human_attribute_name(column.name)} #{as_('BETWEEN'.downcase).downcase} #{I18n.l(from)} - #{I18n.l(to)}"
else
from, to = controller.class.date_bridge_from_to(column, value)
"#{column.active_record_class.human_attribute_name(column.name)} #{as_(value[:opt].downcase).downcase} #{I18n.l(from)} #{value[:opt] == 'BETWEEN' ? '- ' + I18n.l(to) : ''}"
end
end
|