Questions tagged [time-select]
27 questions
11
votes
5 answers
Time select form helper with 12 hour format for Rails 3?
Is there a user-friendly time_select for Rails 3? The default time_select form helper gives you hours[00-23], minutes[00-59] and optionally seconds[00-59]. A dropdown list of hours 0-23 is pretty frustrating for those of us who aren't on military…

swese44
- 373
- 2
- 3
- 9
6
votes
2 answers
time_select with 12 hour time and Time Zone in Ruby on Rails
I have the need to capture a time and time zone from users of a rails 2.3.8 app, but have been unable to think of a clean solution to create and parse the selections.
Ideally I would have a drop-down menus for the following:
hour (1-12)
minute…

jessecurry
- 22,068
- 8
- 52
- 44
6
votes
4 answers
How to get ClockPicker for Bootstrap (Plugin) to appear in a Bootstrap Modal pop up form?
Here is the link to ClockPicker for Bootstrap: http://www.jqueryrain.com/?B83aD_dg
It works perfectly; however, when I try to use it to fill in a text-input in a Bootstrap modal pop up, the clock appears behind the modal pop up. How can I get the…

Grace
- 131
- 1
- 3
- 8
5
votes
1 answer
How to create a 12 hour (with AM/PM) time select element?
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…

Mohit Jain
- 43,139
- 57
- 169
- 274
4
votes
1 answer
Remove ":" from the ruby on rails time_select helper output?
I want to remove the ":" from the output of the rails time_select helper. The helper seems to output this automatically when the minutes select box is built.
Any ideas?
Thanks!

Tony
- 18,776
- 31
- 129
- 193
3
votes
1 answer
time_select blank field saves a default time when form is submitted
Im having trouble understanding my options for time_select. My goal is to have only user created time selections render in my show action after form submission.
What is happening however is a default time of 12:00 AM being rendered for all…

sirramongabriel
- 583
- 1
- 11
- 27
2
votes
2 answers
Ruby on Rails: time_select default value
I have been looking for a solution for this problem for hours. There are plenty of recommendations even here on stackoverflow and I tried all of them but none of them work in my case and I don't know why.
I have the current version of RoR [4.1.5]…

RichiMartin
- 81
- 2
- 10
2
votes
0 answers
rails reject_if for time fields
sorry for my english, my question is: how can I check empty time fields on reject_if block. Here is a bit of my code.
accepts_nested_attributes_for :working_times, :allow_destroy => true, :reject_if => proc { |attributes|…

el_quick
- 4,656
- 11
- 45
- 53
1
vote
2 answers
Programatically accessing HTML attributes with Javascript
I'm using a custom TimeSelector, which I place on the page in HTML as follows:
In a Javascript function, I'd like to update the Date…

Jeremy
- 5,365
- 14
- 51
- 80
1
vote
1 answer
I only want certain hours on my rails time_select form
In my app, users should only be able to select times between 10am and 12pm, and then 4pm and 6pm. Basically I want my 'hours' drop-down menu to only list "10am, 11am, 12pm" and "4pm, 5pm, 6pm". Is this possible?

Josh Kestenberg
- 119
- 11
1
vote
2 answers
How to prevent jQuery bootstrap ClockPicker to get minutes that are not divisible by 5
I am using jQuery bootstrap ClockPicker and need to get only times that their minutes are divisible by 5. For example if user selects 13:08, the ClockPicker should select 13:05.
Is there a way to override clockpicker to round down selected times…

Forough
- 262
- 4
- 20
1
vote
4 answers
How do I set a time in a time_select view helper?
I have a time_select in which I am trying to set a time value as follows;
<%= f.time_select :start_time, :value => (@invoice.start_time ? @invoice.start_time : Time.now) %>
This always produces a time selector with the current time rather than the…

brad
- 9,573
- 12
- 62
- 89
0
votes
1 answer
How to make to combine time_select into one drop down menu?
I`m currently using:
<%= f.time_select :day,:default => Time.now, :ampm => true, :minute_step => 15 %>
Which gets display as two separate boxes, one for select_hour & one for select_minutes.
Is there a simple way to combine them, so I`ll get 6:00 /…

Big_Bird
- 427
- 8
- 21
0
votes
1 answer
How to disable time in ajax time selector
Please suggest how to hide time slot in ajax TimeSelector. I want to set the time between 9:00 pm to 6:00 am
I am already tired by setting EndTime and StartTime to the TimeSelector
Here is my time selector

Nivas Khatal
- 31
- 7
0
votes
3 answers
How to style rails time_select field?
I want to add bootstrap form-control class to rails time_select control. I try this but it doesnt work.
<%= time_select :open_time, :prompt , :default => {:hour => '9', :minute => '30'} , class: "form-control" %>

onder
- 795
- 3
- 14
- 32