lib/formtastic/inputs/date_input.rb in formtastic-2.1.1 vs lib/formtastic/inputs/date_input.rb in formtastic-2.2.0.rc
- old
+ new
@@ -1,34 +1,10 @@
module Formtastic
module Inputs
- # Outputs a series of select boxes for the fragments that make up a date (year, month, day).
- #
- # @see Formtastic::Inputs::Base::Timeish Timeish module for documentation of date, time and datetime input options.
- class DateInput
- include Base
- include Base::Timeish
-
- # We don't want hour and minute fragments on a date input
- def time_fragments
- []
+ class DateInput < DateSelectInput
+ def to_html
+ ::ActiveSupport::Deprecation.warn("DateInput (:as => :date) has been renamed to DateSelectInput (:as => :date_select) and will be removed or changed in the next version of Formtastic, please update your forms.", caller(2))
+ super
end
-
- def hidden_date_fragments
- default_date_fragments - date_fragments
- end
-
- def hidden_fragments
- hidden_date_fragments.map do |fragment|
- template.hidden_field_tag(hidden_field_name(fragment), fragment_value(fragment), :id => fragment_id(fragment), :disabled => input_html_options[:disabled] )
- end.join.html_safe
- end
-
- def fragment_value(fragment)
- if fragment == :year
- Time.now.year
- else
- '1'
- end
- end
end
end
-end
\ No newline at end of file
+end