How to create a 12 hour (with AM/PM) time select element?

1.4k Views Asked by At

I am using rails 3.2.13. I want to show 12 hours of clock and am/pm also in dropdown. Seems lot of people talking about this but there is no inbuilt solution for the same.

time_select("post", "written_on", {:ampm => true})  # it gives me just two dropdowns. No dropdown for am/pm
f.time_select :written_on, :ampm => true  # same here. No third dropdown for am/pm

Any suggestions?

1

There are 1 best solutions below

0
On BEST ANSWER

It's best to just delegate this to a good client side JS library. Below is what I personally use for my clients; it's awesome.

http://amsul.ca/pickadate.js/