Rails 12 hour AM/PM range for a day

前端 未结 3 1559
眼角桃花
眼角桃花 2021-02-05 13:43

This is a really simple question, and it\'s probably been asked and answered before, but I haven\'t been able to find anything.

Anyway, I need a range/array for 12 hour

3条回答
  •  梦毁少年i
    2021-02-05 13:49

    Rails does this built in

       <%= f.time_select :start,  {ampm: true} %>  
    

    http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-time_select

提交回复
热议问题