blob: 71628f128d244343b5dce7a67cb69d8366cff678 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
class ExtendedTimePickerInput < Formtastic::Inputs::TimePickerInput
def value
return options[:input_html][:value] if options[:input_html] && options[:input_html].key?(:value)
val = object.send(method)
return "00:00:00" if val.is_a?(Date)
return val.strftime("%H:%M:%S") if val.is_a?(Time)
return "00:00:00" if val.nil?
val.to_s
end
end
|