see strftime
Sorry about that
File vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb, line 209
It seems as though it only goes from 0-23.
You can define your own select_hour (my_select_hour) and basically:
209: def my_select_hour(datetime, options = {})
210: val = datetime ? (datetime.kind_of?(Fixnum) ? datetime : datetime.hour) : ‘’
211: if options[:use_hidden]
212: hidden_html(options[:field_name] || ‘hour’, val, options)
213: else
214: hour_options =
215: 0.upto(23) do |hour|
216: hour_options << ((val == hour) ?
217: %(#{leading_zero_on_single_digits(hour)}\n) :
218: %(#{leading_zero_on_single_digits(hour)}\n)
219: )
220: end
221: select_html(options[:field_name] || ‘hour’, hour_options, options)
222: end
223: end
Change 217/218 to read something like
%(#{ (hour == 0 ? 12 : ( hour > 12 ? hour - 12 : hour )) } #{( hour >= 12 ? “PM” : “AM”)}\n) :
%(>#{ (hour == 0 ? 12 : ( hour > 12 ? hour - 12 : hour )) } #{( hour >= 12 ? “PM” : “AM”)}\n)