search for: birthdate

Displaying 20 results from an estimated 33 matches for "birthdate".

2006 Jan 22
23
calculate users age
i know it''s probably really simple, how do i work out someone''s age if i have their d.o.b. stored as a date in my db. cheers -- Posted via http://www.ruby-forum.com/.
2006 Jan 07
4
set date with date_select
when retreiving a date from a DATETIME field in a database, is there a way to set the date to the value of the DB in the view? It seems to always default to the current date... if I have a field called birthdate in the users table and i do @user = User.find(@params[:id]) in my view i have a <%= date_select ''birthdate'',''user'' %> but dont know how to set a value for date_select that isnt the current date. Any ideas ? thanks adam
2006 Feb 20
1
extract month from date column
Hi, I have this rails query: @birthdays = Birthday.find :all, :conditions => ["user_id = ? and birthdate = ''2006-02-01'', @user_id], :limit => @birthday_pages.items_per_page, :offset => @birthday_pages.current.offset You can ignore the user_id, limit and offset part. Birthdate is date type. That query lists the ro...
2007 Nov 03
3
Birthdate validation
Hello everyone, I''m almost cracking my head trying to do this birthdate validation. It turns out that I can only accept users with at least 18 years old and I''m trying to validate it writing this code on my user.rb fil at app/ models class User < ActiveRecord::Base validates_presence_of :full_name validates_presence_of :street_address validates_presence...
2009 Feb 20
3
mean over previous cells
...2008-01-01 22.2 2008-01-02 21.8 2008-01-03 22.8 2008-01-04 22.9 2008-01-05 23.1 2008-01-06 23.2 ... ... now, I would like to add a column that shows the mean SST over the last (e.g.) 60 days (for that specific date). My biological question is, whether the birthweight of an animal at a specific birthdate changes due to the SST over the last 60 days before birth. (SST is an indicator for food abundance - if food is scarce, mothers can't feed much and hence, pups are born lighter!?) Up to now, I can only show, whether the SeaSurfaceTemperatures on the birthdate can have an influence on birthweigh...
2006 Jan 04
5
How do I set the default value for date fields?
...(see below for the table''s sql syntax). So it looks like I need to code something, but I''m unsure to put that in the model or in the view (or if this is a form helper deal). Any help is appreciated. Thank you in advance! CREATE TABLE volunteers ( ......other columns.... birthdate date default NULL, competency_in_service_on date NOT NULL default ''0000-00-00'' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- Posted via http://www.ruby-forum.com/.
2006 Jan 19
2
date_select broken
I am using date_select and in some instances it only shows about 10 years worth of choices. Same form on other users shows the whole range. date_select looks like this <%= date_select ''user'',''birthdate'' , :start_year => 1940 %> I would expect to always see 1940-2006 or so , but i dont always do. Is there a way to force the range or explain why i woudlnt always see this range ? thanks adam
2008 Jan 12
2
Problems with date field
Hi, I''m creating a date type field to put birthdate, but the years on this field only go to 2003, what should I do?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TL...
2009 Jul 02
3
Testing for membership in an array of strings
...n on the data frame to select only data for "sue" or "jane" (for example.) But maybe I have not taken the correct approach? So obviously I could do something like the following. subset( data_frame, name = "sue" | name == "jane", select = c(name, age, birthdate)) However, my subset needs to be much more than 2 and being lazy I do not want to type "| name == "some text" for each one. Is there an other way? Neil
2006 Jan 06
0
date_select and sessions
i am using date_select to allow someone to select their birthdate in a form. however date_select uses 3 wierd labels in the forms like follows: <select name="user[birthdate(1i)]"> <option value="1940">1940</option> <option value="1941">1941</option> . and then the month is user[birthdate(2i)] and so o...
2006 Nov 02
0
DB: class to multiple rows mapping (aka rails 'osproperty')
...int, object_type varchar(255), key_name varchar(255), value_type int, value_int int, value_char varchar(255), value_longchar text, ... primary key (id, object_type, key_name) ) then I could map any instance of any class to it. E.g. class User def initialize(firstname, lastname, birthdate) @firstname = firstname @lastname = lastname @birthdate = birthdate end end would end up being stored as multiple rows one for each instance property, all indexed with object_type = ''user'' and id = @user.id. I just wonder if this sort of design would be not fitting...
2009 Mar 02
0
Implementing conditional read-only attributes of ActiveRecord objects
...specifying a condition in attr_protected, attr_readonly and possibly other attribute methods in ActiveRecord objects. Rationale (example): class User < AR:Base # User should not be able to modify fields any more once they have been verified attr_readonly :firstname, :lastname, :gender_id, :birthdate, :if => :passport_verified? # ... end or, even better yet, attr_protected with the same options, since this will allow an admin controller to directly write the attributes while the "normal" user forms will just ignore them. The ":if" option should, like in validations, a...
2012 Nov 12
2
how to enter a string value
...ing my goal is to enter three string: name and surname and date of birth I try with this code but it shows me errors print ("enter the name") name <- scan (nmax = 1) print ("enter the first name") firstName <- scan (nmax = 1) print ("enter the date of birth") BirthDate <- scan (nmax = 1) best regards alen -- View this message in context: http://r.789695.n4.nabble.com/how-to-enter-a-string-value-tp4649313.html Sent from the R help mailing list archive at Nabble.com.
2006 Feb 08
6
can''t get date_select to work
Hi, I render a couple of date_select fields, the HTML looks fine, I can see the values submitted back to the server, but AR doesn''t pick them up from the hash in Booking.new(params[''booking'']). I''ve got a ''booking'' object with parameters product, startdate and enddate. HTML snippets: <select
2006 Mar 10
19
validates_date plugin for ActiveRecord
This plugin gives ActiveRecord the ability to do stricter date checking. Example: class Person < ActiveRecord::Base validates_date :date_of_birth end This will ensure that date_of_birth is a *valid* date. The date can be set initially as a string in any of the following formats: "2006-01-01" "1 Jan 06", or "1 Jan 2006" "1/1/06" # Day /
2006 Dec 15
4
Why won't Rails update my object attributes?
...t;people", "image"=>{"data"=>#<StringIO:0x4c22474>}, "person"=>{"occupation"=>"", "schools"=>"", "religious_preference"=>"Agnosticism", "dislikes"=>"", "birthdate(1i)"=>"1988", "gender"=>"male", "birthdate(2i)"=>"12", "is_smoker"=>"0", "birthdate(3i)"=>"13", "first_name"=>"Test", "homepage_url"=>"", &quot...
2006 Feb 22
1
managing dates in forms
Hi, I have a field for the user which is their birthday. I am letting them edit it and then save it if they want. However, the form displays the current date/time, and when they save the form without changing the birthdate (because they do not wish to set it), the current date/time gets saved to the db. How do I do this? I thought about having a hidden field which would be the current date/time and after they submit the form, compare it to the nonhidden value to see if they changed it, but I feel like that is not a c...
2009 Mar 26
1
Is there a public blacklist of hackers' IPaddresses?
...st MD5... and switching from MD5 to SHA-1 provides no significant defense against dictionary attacks. The only good way to keep passwords secure against dictionary attacks, is to make sure that the passwords aren't guessable by that means... no common words, no names, no simple permutations or birthdates or anything like that. Use a decent random-number generator and number-to-character conversion algorithm to generate SIP passwords that are sufficiently long and very DTR8FBWF_==F?Z@\.-+!N$ and you'll be well defended.
2012 Sep 15
0
Random Forest and Correlated Fields
...example if we are trying to predict who might leave our company to go work for another company some of the variables we may look at are below (in addition to others). Do we need to be cautious with comingling these especially since, for example with Age variable, all are based on the same variable: birthdate? Or rollup fields: Age rolls up to "Age Cohorts" and "Age Cohorts" rolls up to "Age Career Cohort"? - BIRTHDATE BASED VARIABLES 1. Age 2. Age Cohorts (i.e. 20-30, 30-40 yrs old, etc) 3. Age Career Cohort (similar to above but wider bin i...
2007 Sep 21
1
calculate age of a person and compare it
how can i calculate the age of a person using database " birth date" my teble is user and column is bday .... now i want to calculate the age will some one please tell me how can i calculate the age.. actually i want to compare my two database fields birthdate and joining date ......that is why i need this.... will someone please tell me how can i do that --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai...