From e9afed579ca54c4126cb7371c698398fc25d4adb Mon Sep 17 00:00:00 2001 From: Matt Powell Date: Thu, 29 Jul 2010 13:55:32 +1200 Subject: [PATCH] Fix time_select so that minutes are rounded down to the nearest step when using the :step option [#5236 state:resolved] --- actionpack/lib/action_view/helpers/date_helper.rb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 8050669..669ffbb 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -804,6 +804,7 @@ module ActionView leading_zeros = options.delete(:leading_zeros) select_options = [] + selected = selected && (selected / step) * step start.step(stop, step) do |i| value = leading_zeros ? sprintf("%02d", i) : i tag_options = { :value => value } -- 1.6.5.2