aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/week_field.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags/week_field.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tags/week_field.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/week_field.rb b/actionpack/lib/action_view/helpers/tags/week_field.rb
index a1265d9928..1e13939a0a 100644
--- a/actionpack/lib/action_view/helpers/tags/week_field.rb
+++ b/actionpack/lib/action_view/helpers/tags/week_field.rb
@@ -1,19 +1,10 @@
module ActionView
module Helpers
module Tags
- class WeekField < TextField #:nodoc:
- def render
- options = @options.stringify_keys
- options["value"] = @options.fetch("value") { format_week_string(value(object)) }
- options["min"] = format_week_string(options["min"])
- options["max"] = format_week_string(options["max"])
- @options = options
- super
- end
-
+ class WeekField < DatetimeField #:nodoc:
private
- def format_week_string(value)
+ def format_date(value)
value.try(:strftime, "%Y-W%W")
end
end