Displaying 20 results from an estimated 8000 matches similar to: "Combine date and time in mysql"
2006 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a
time input for an ActiveRecord field of type :time.
I just want an hours input and a minuites input. I can get these with
time_select helper using :field_name and :prefix but it gives both hours
and miniutes the same name.
<%= select_time(Time.now, :prefix => "search", :field_name =>
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
Hello all,
I am currently writing model tests in rails 4. I am attempting to add an
error to a reservation object if the total number of reservations for a
given date and time has reached a pre-determined limit.
When my test runs, it is hitting the appropriate code but it is raising the
following error as opposed to just giving me an error in the object that I
can use.
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
2012 Oct 12
1
Adding Time when Blanks
Greetings,
My data set has dates and times that I am working with. Some of the times
in Time_of_end are blank. This is supposed to dictate that the particular
experiment lasted 48 hours. I would like to add 48 hours to the start
Start_of_Experiment for another column as End_of_Experiment including both
the ones with 48 added and those with early times. I was thinking
something with a
2005 Dec 01
0
Problem using a date helper
Hi,
I''m having trouble getting a date helper working. I was pointed to
this by Sean Allen, and it resides at
http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes
It''s meant to fix the bug in Rails which doesn''t allow datetime_select
to properly discard the year.
So, I''m trying to use the helper''s time_select function.
date_helper.rb
2011 Aug 27
0
calender_date_select
<td class="col-1">
<div class="label-field-pair3">
<div class="text-input-bg3">
<%= exam_form.calendar_date_select :start_time %>
</div>
</div>
</td>
Error:`@new[exams]'' is not allowed as an instance variable name
wht shell i do .i have installed the gem also it is
2012 Feb 02
0
calendar date select
Hi,
In my application I am using calendar_date_select gem to pickup
date and time from browser.
The problem I am facing is:
My application server is in us and when I tried to access the
application from my machine(India) the calendar_date_select returns the
time of my local machine. It does not pickup time from the server. Is
there any way to get server time.
I have gone
2007 May 01
5
duplicate key violates unique constraint
I''ve run into an interesting issue. When setting up a table with data
from a file (I''m doing this in a block). I find that I can''t create
separate entries manually after the import. It complains about a
duplicate primary key. I''ve tried Schedule.id += 1 but id= either
isn''t defined or accessible in the class
Here is my code:
2008 Dec 06
1
find with add of an atttributes
I have wrote this:
EventDate.find(:all,
:include => [:container,{:event =>
[:photo,:event_type_names]},{:place=>:location}],
:joins =>" RIGHT JOIN (SELECT
event_dates.id,date_add(event_dates.date, INTERVAL i DAY ) AS date
FROM (select 0 as i union all select 0 union all select 1
union all select 2) as integers CROSS JOIN event_dates
2013 Jan 29
2
Count entries in postgresql grouped by date
Hi!
I have a table with visits with a visited_at: attribute which is a datetime
field. They seem to be stored as UTC. Now I want to count all visits each
day and return something like:
{
2013-01-01: 8,
2013-01-02: 4,
2013-01-07: 9,
...
}
So, I did it like this which kind of works...:
def self.total_grouped_by_day(start_date, end_date)
visits = where(visited_at:
2007 Nov 14
0
Problem time_select with fields_for
Hi,
I''m using fields_for and a time_select but he isn''t saving the time in
the db just 00:00:00
All the other fields are fine, but the time_field isn''t working:s
This is my code:
<% form_for :activity, @activity,:url => {:action => "create"} do
|activity_form| %>
<td><%= activity_form.time_select :datum_1_twrak_van, :order =>[ :hour,
2012 Jun 30
6
Scheduled_task + ad user
Hi,
When a want to use scheduled_task for create a windows task and when i
give a AD user, i have this message :
err: /Stage[main]/Mirnas/Scheduled_task[test]/ensure: change from absent
to present failed: Invalid user: DOMAIN\oper
My user domain and the password are correct.
I have the same error if i change DOMAIN\oper by oper@domain.com
or DOMAIN/oper
With a local user, is working, but i
2011 Feb 03
1
How to transfer a javascript value into a symbol used in Ruby on Rails
Hi,
I am currently using Rails 2.0.2 with Ruby 1.8.7. My Prototoype.js
version is 1.7(if required). I am basically trying to integrate the
calendar_date_select plugin in my app.
The link/tutorial I am referring is: http://ianli.com/site/HowTo/UseCalendarDateSelectRailsPlugin
I am trying to save the date I receive through the date select plugin
and store in a rails symbol :publishing_date.
I am
2006 Jul 25
4
Sorting by two fields
I have a list of TimeSheet objects from an ealier AR query, which I
can sort by the full name of the user like so:
@time_sheet_entries.sort! { |a,b| a.user.full_name <=> b.user.full_name }
I can sort by the started time like so:
@time_sheet_entries.sort! { |a,b| a.start_time <=> b.start_time }
My question is how do I do a sort so that the list is sorted primarily
by user.full_name
2008 Apr 04
4
Auto Complete Problems
Hello All,
I''m a RoR newbiew, trying to experiment with Autocomplete, but I''m
having some difficulties. When I start typing in my input box, instead
of getting a nice drop down, the styling on my page is getting all out
of wack (ie my background colours change, link styling changes, etc) and
I''m not seeing any autcompletion data. Here are the steps I''ve taken
2007 Jul 18
0
very strange date problem for the month may
Hi,
I use the calendar_date_select plugin
(http://code.google.com/p/calendardateselect/)
which is working fine, but the strange thing is:
if i debug my application, i can see that the date is received by the
controller in the format ''july 10, 2007''
somewhere this gets translated (not by my application) in a format which
mysql understands, because i can save this record correct
2013 Mar 14
0
[Rails 3.2] accepts_nested_attributes_for and time_select
Hi, I am upgrading a Rails application from Rails 3.1.11 to 3.2.12, but
have a problem with ` accepts_nested_attributes_for` in conjunction with
multipart attributes.
The app is used to manage oral exams, so there is a model `Exam`, which has
many `Examdate`s. When creating an exam, I can also create the examdates,
consisting of a date, a start time and an end time. While the date field is
2007 Aug 07
0
Newbie: Want to use time_select to partial fill a datetime field
Hello
Our Database schema, and hence Our Model has a few datetime columns/
fields. But when entering new instances, We only want to present time
(i.e. HH:MM) in in our HTML views to the user. The time_select looks
useful, because it has an attractive minute_select: =>15, so the user
can enter 1/4 hours increments. The idea being that we would default
the Date part of Datetime attribute to
2009 Jan 21
1
Looking for a special date function in R
Hello, everyone
I wonder if R has something similar to Excel function
EDATE(start_date; months) which returns a serial number of the date
that is the indicated number of months before of after the start date.
Example (the second column EDATE(first_column; -6)):
01.01.1999 01.07.1998
02.02.1999 02.08.1998
06.03.1999 06.09.1998
I am working with a zoo object where the row names are dates and for
2006 Feb 28
5
Problem with paginate, include and foreign keys
Hi all,
Solaris 10
Ruby 1.8.4
Rails 1.0.0
Postgres 8.1
postgres driver 0.7.1
I''m having a problem with getting paginate() to properly pick up an FK
constraint properly.
I don''t seem to have this issue with ActiveRecord, however. Consider:
create table start_dates (
id bigserial,
start_date date unique,
max_slots int default 40,
primary key (id)
);
create