12 hour time select plugin

Plugin details

This is a simple plugin that overrides the default select_time method in order to provide support for a 12 hour clock. The 24 hour time functionality is fully retained.

Repositoryhttp://cubesix.net/rails/plugins/12_hour_time_select/ Tags Date, Time LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://cubesix.net/rails/plugins/12_hour_time_select/

In your view, add

<%= select_time(datetime, :twelve_hour => true) %>



For example, when creating a time object in your controller, do like so:

   @new_job.time = params[:date] + ' ' + 
     params[:time][:hour] + ':' + 
     params[:time][:minute] + ' ' + 
     params[:time][:meridiem]



Ruby will take care of the rest.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, 6 months ago