Displaying 20 results from an estimated 1000 matches similar to: "Getting a time select input"
2006 Mar 21
5
Use select_date for my model?
Hi all
I have a model "party" that has a time field "starts_at". I have created
a form to add new instances of this model.
<%= select_date Date.today, :prefix => ''party'' %>
Sadly I get the error:
NoMethodError in Parties#add
undefined method `month='' for #<Party:0x256a600>
How can I fix this problem? I remember that I saw in
Overriding date_select in local project to use custom value rather than blank for starting option...
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a
behavior similar to what you get using date_select with the
:include_blank => true option where the first value in the dropdown is
"- Month -", "- Day -", or "- Year -" rather than a blank value for
the respective month, day, and year select fields.
I took a look at the ruby source for
2005 Dec 23
6
Selecting time
I''m currently building a small app that''s going to be used to keep track
of the amount of time spend on customers of the company I work for.
This mainly consists of object with a begin time, an end time and a
calculation of the difference between those timestamps (actual time
spend on the job).
I made a small form with a datetime_select helper for the begin and end
time (the
2006 Feb 07
9
Is there a good time_select tag helper?
I''m trying to record a list of start and end times, and they''re simply
an hour and a minute. Looking at the API, there''s a select_time
helper, but that just creates the tag. There''s a datetime_select
helper which takes an object and method name, so it does all the
magic...but I only want to worry about the hour and the minute. I''ve
tried writing my
2005 May 02
1
datetime_select and discard
ok so datetime_select if you use the discard options
say { :discard_month => true }
when you just do update_attributes on said object
year would be correct
month would be the hour
date would be the minute
so if you select
year: 2005
hour: 12
minute: 13
the time object would go into the db as:
''2005-12-13 00:00:00''
so my question is how do i get the time object properly
2006 Jun 16
3
finding out about options
I''ve been to the RoR api docs trying to find out
about options for various methods (mostly for
select helper methods), yet I find no listing of
options even when the method described says
that it takes options. How
can I find out what are valid
options say for a date_select tag?
Thanks,
Dave
2006 Mar 12
3
select_time help needed (Noob)
I can''t seem to get a handle on how the select_time helper is supposed
to work. I''m a complete noob to rails so bear with me please. I''m trying
to add fields to a form to allow for time (hh:mm) selection ie. call
received, enroute, etc.. I don''t understand how one maps the form data
to the table object and field ie. calls table recieved field.
2006 Jan 26
3
discard_year => true
Hi All
I''m attempting to make a simple time select field so I thought I just
needed a datetime_select with the option :discard_year => true.
However, every ''discard'' option except discard_year seems to work. So
I''m left with a year, hour and minute to select.
Could anyone please point me in the right direction?
Much appreciated.
Doug
--
Posted via
2006 Apr 15
2
Multi-parameter assignment
Hi,
I''m trying to submit data from text boxes on a form to one variable in
my controller, in the same way that datetime_select has date(1i),
date(2i), etc for day, month, year, etc...
I''ve named my variables event[start_date(1i)] event[start_date(2i)] and
event[start_date(3i)] but this doesn''t seem to work and
event[:start_date] is blank ... any pointers would be
2007 Dec 12
3
datetime_select and Active Record
If I have a form similar to the one below, and ''start'' is a "string"
field in my Database. Is there a way to take all of the date/time
params and put them into ''start'' without too much hacking? I would
like this to be as clean as possible.
<p><label for="start_time">Start Time</label><br/>
<%=
2006 May 18
4
time select with am/pm?
Hi everyone,
Is there a time select helper which uses a 12 hour clock rather than a 24
hour one? Also, does anyone know if :discard_year actually works in
datetime_select now, or how I could find this out?
Thanks!
Daniel
2006 Feb 05
0
How can i specify default time to datetime_select tag
I want to specify a different default time to datetime_select tag how
can i do that.
also i was looking at rails helper code
-----------------------------------------------------------------------
module ActionView
module Helpers
module DateHelper
def to_datetime_select_tag(options = {})
defaults = { :discard_type => true }
options = defaults.merge(options)
2006 Oct 13
5
Insert NULL into MySQL "time" not 00:00:00
Ok I''m not sure what I''m doing wrong, but I have a table that holds a
bunch of times, however when I don''t fill in the text box that passes
it''s input on to the variables, rails defaults to 00:00:00, which is
bad, because that''s midnight.
I''m pretty sure I''m doing somethign wrong, and I''m even thinking of
using the
2006 Jan 25
0
datetime_select discard year bug?
I''m trying to have a select box for starting time. I''m using:
datetime_select(:user, :start, :discard_year=>1) but I get an error.
"discard_month=>1" seems to work but leaves the year on the form. Using
Rails 1.0 and Postgresql. Anyone having success with this?
2007 Nov 02
1
1 error(s) on assignment of multiparameter attributes - Very Strange
Hello...
Well, I post this one without too much hope that someone will be able
to give me an answer, because it is strange.
I have a time select field, the field on the database is of type time
only.
When creating a document, as long as the time is not greater than
14:00, then it saves as 00:00, but if the time is greater than 14:00
and less than 22:00 then it throws this error:
1 error(s) on
2005 Dec 12
1
Search screens with dates
Tried googling and searching the lists for this. I''d like to do a
search on some dates and naturally enough use the date helpers. I
have a number of problems:
-- datetime_select wants an active record model
-- select_datetime does not take the options that datetime_select
take - specifically :order
that leaves me with something like
<label>Date/Time
2009 Mar 13
2
date_select and HTML options?
I have the following code, but can''t seem to get the class attribute
to show up in the generated select elements. I saw something about a
bug/patch. However, as am still learning RoR I didn''t want to jump to
conclusions. Anyone see anything wrong:
<%= f.date_select :expiration_date, :order =>
[:month, :year], :discard_day => true, :class => "dtfld" %>
2006 Jan 20
2
select_time issue: how to get hours only upto 12 along with AM/PM
My code is like this:
<%= select_time () %>
1) I would like to pass more options so that the a blank value is at the
top. I tried ":include_blank => true" but it didn''t work.
2) I would like to limit the number of hours to only upto 12. With the
current code the hours has value rangin from ''00'' to ''23''
3) Would like to have
2006 Jul 26
2
text_field and date_select in collection
hello,
i would like to display a collection of records on one page (e.g. an
author record with all his/her books).
a record contains a text_area (e.g. a description of the book) and a
date_select (e.g. when the book was published).
<% for @book in @author.books %>
<%= text_area ''book[]'', ''note'' %>
<%= datetime_select
2008 Jul 04
4
select_datetime // datetime_select
Hi I have 2 question for you guys,
1. Which is the difference between this two methods? (select_datetime,
datetime_select)
2. How I assign the selected date-time values, to an specific variable
or array using select_datetime
I know do it using datetime_select(''object'',''method'')
I aprecciate your attention.
Thanks
PD: Sorry about my english.