time-select

time_select blank field saves a default time when form is submitted

痞子三分冷 提交于 2020-01-15 06:41:47
问题 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 time_select fields not touched by a user. I am looking for a way to either stop default time values from saving (which if I had to guess, isn't possible), or create a conditional that would allow me to prevent default time values from rendering. I have

How do I set a time in a time_select view helper?

和自甴很熟 提交于 2019-12-24 08:49:49
问题 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 value for @invoice.start_time. @invoice.start_time is in fact a datetime object but this is passed to the time selector just fine if I use <%= f.time_select :start_time %> I guess what I'm really asking is how to use the :value option with the time

How to prevent jQuery bootstrap ClockPicker to get minutes that are not divisible by 5

隐身守侯 提交于 2019-12-20 03:55:10
问题 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 minutes? 回答1: I didn't found a way to do this with the API. So I wrote one using afterDone callback. I parse the input's value and make the change to get the new minutes value. var clockpicker = $('.clockpicker').clockpicker({ afterDone: function() {

How to get ClockPicker for Bootstrap (Plugin) to appear in a Bootstrap Modal pop up form?

吃可爱长大的小学妹 提交于 2019-12-10 08:23:22
问题 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 clock picker to appear in (or in front of) the modal pop up instead? Here is an image of what happens: I've tried changing the z-index of the div to be in front; I've also tried changing the z-index of every element in clockpicker.css to be in front

Time select form helper with 12 hour format for Rails 3?

纵饮孤独 提交于 2019-12-10 01:52:34
问题 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 time. A user-friendly solution would display hours 1-12 and an extra am/pm dropdown list. Is there an option or a separate plugin to handle this? I can't be the first person to want this, but I haven't found any solutions. Thanks! 回答1: You can set

How to get ClockPicker for Bootstrap (Plugin) to appear in a Bootstrap Modal pop up form?

微笑、不失礼 提交于 2019-12-05 17:36:17
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 clock picker to appear in (or in front of) the modal pop up instead? Here is an image of what happens: I've tried changing the z-index of the div to be in front; I've also tried changing the z-index of every element in clockpicker.css to be in front (for example: z-index: 1120). However, all this does is make the clock disappear. <div class="modal

Time select form helper with 12 hour format for Rails 3?

寵の児 提交于 2019-12-05 00:56:51
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 time. A user-friendly solution would display hours 1-12 and an extra am/pm dropdown list. Is there an option or a separate plugin to handle this? I can't be the first person to want this, but I haven't found any solutions. Thanks! You can set :ampm option to true which will show the hours as: 12 PM, 01 AM .. 11 PM. time_select 'game', 'game_time', {

time_select with 12 hour time and Time Zone in Ruby on Rails

我与影子孤独终老i 提交于 2019-12-04 12:31:40
问题 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 (0-59) AM/PM Time Zone Is there a gem/plugin that accomplishes what I am looking for? Will I need to store both the time and time zone in the database? What is the best strategy for storage? I'll eventually need to spit these values out in UTC, but a