Skip to content

Commit

Permalink
comply with the ampm option to also provide 24hour format
Browse files Browse the repository at this point in the history
  • Loading branch information
thimios committed Jun 21, 2013
1 parent ef16f1a commit 0b63e1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/combined_time_select.rb
Expand Up @@ -60,9 +60,11 @@ def select_minute_with_simple_time_select
ampm_hour = ampm_hour(hour)

val = "#{hour_padded}:#{minute_padded}:00"

option_text = @options[:ampm] ? "#{ampm_hour}:#{minute_padded}#{ampm}" : "#{hour_padded}:#{minute_padded}"
minute_options << ((val_minutes == minute) ?
%(<option value="#{val}" selected="selected">#{ampm_hour}:#{minute_padded}#{ampm}</option>\n) :
%(<option value="#{val}">#{ampm_hour}:#{minute_padded}#{ampm}</option>\n)
%(<option value="#{val}" selected="selected">#{option_text}</option>\n) :
%(<option value="#{val}">#{option_text}</option>\n)
)
end
end
Expand Down

0 comments on commit 0b63e1b

Please sign in to comment.