similar to: Rails Date/Time Validation and Parsing

Displaying 20 results from an estimated 10000 matches similar to: "Rails Date/Time Validation and Parsing"

2008 Apr 25
0
Date validation :before -1 day
I really liked the tool but I have got stuck in one case. I am in urgent need of your help regarding validates_date :sale_start, :before => :sale_end, :after => Proc.new { -1.day.from_now.to_date } validates_date :sale_end, :after => [:sale_start , Proc.new { -1.day.from_now.to_date }], This is Okay but there may be the
2006 Jan 16
3
String date parsing
Does anyone know if a Ruby package has been written to handle functionality similar to php''s strtotime(). I''m looking for something that can parse almost any string (such as "1 day ago", "+1 week", "last tuesday") into a timestamp. I''ve played with ParseDate, but it doesn''t seem to do what I need. Any suggestions? Derek
2006 Aug 11
4
date (age) validation
I have an application that requires users to be in a specific age group, or above a certain age. For simplicity sake lets say they have to be at least 18. This is my most recent attempt to produce the desired result: validates_exclusion_of :birthday, :in => Range.new(Date.today, Date.parse( (18.years.ago).strftime(''%Y/%m/%d'') )), :message => "does not meet
2006 May 11
4
string to date/time?
Hey All, Anyone know of a library for parsing "human" dates, like "this friday" or "2 days ago"? I used to use strtotime in php, but starting from here; http://wiki.rubyonrails.com/rails/pages/PhpStrtotime and doing lots of googling, I haven''t been able to find anything similar for ruby. I know of javascript solutions to this, but I''d need to do
2006 Apr 09
6
Validating a DateTime
Hi, Does anyone know of a method to validate a DateTime field? I''ve looked at the validation docs and the validates_date / validates_time plug-in but I can''t find a method to validate a value in the format of yyyymmddhhmm. It seems like something that should exist already, so I''d just like to check before I attempt my own version... Cheers, Mark
2005 Nov 29
1
[OT] Sanitizing Characters In Pasted Text
Because Microsoft Word changes quotes to curly quotes, double dashes to en-dashes, etc., copied / pasted text from Word into a textarea can contain characters not rendered the same in all browsers. Put more bluntly, when they paste from Word, it looks like cr@p on my Mac. I¹ve seen this question asked before, but never seen the answer. Is there any translation table between Word¹s special
2005 Oct 15
14
OT: Anyone Using a Time Logger?
I have multiple projects and it''s important for me to track time by client and by project. There''s a Windows application that allows me to do this, but I''m looking for a cross-platform solution. I looked at ConsultComm but it wouldn''t install on my Mac. Rather than rewriting what seems like a commonly-required app, I wondered if anyone else had something they
2003 Mar 09
0
ogg123 --end 1:59 patch.ogg
Hi Here is another patch regarding time in ogg123 which is more controvercial than the other one I send some days ago. (see attachment) When working with Daisy/SMIL [1] files it would be helpfull if the user could stop play at a specific time. Currently .ogg files are not allowed in the Daisy format but that will hopefully happen one day if I work hard at it. A clip in a Daisy file could look
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 /
2009 Mar 10
0
Alternative to interp.surface() offered
I wanted a simple function for bilinear interpolation on a 2-D grid, and interp.surface() in the fields package didn't quite suit my needs. In particular, it requires uniform spacing between grid points. It also didn't have the "visual" reference frame I was looking for. Here is an alternative function, followed by an example. # A function for bilinear interpolation on a 2-d
2020 Jul 25
0
[klibc:master] tests: Add a trivial test for sysconf()
Commit-ID: 8db4a47db4c72203a9196a2c5d096664de29f8ce Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=8db4a47db4c72203a9196a2c5d096664de29f8ce Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 25 Jul 2020 22:46:16 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 25 Jul 2020 22:46:16 +0100 [klibc] tests: Add a trivial test
2020 Jul 25
0
[klibc:master] tests: Add a trivial test for sysconf()
Commit-ID: 3df6e74ab78fc63aa025d07fb849ec9508cbf1c2 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=3df6e74ab78fc63aa025d07fb849ec9508cbf1c2 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 25 Jul 2020 22:46:16 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 25 Jul 2020 22:51:45 +0100 [klibc] tests: Add a trivial test
2005 Aug 07
0
kbuild: add klibc/tests
kbuild: add klibc/tests to kbuild Add a kbuild file so we now can build the test programs. A new dedicated target is used: make test Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- commit 5492ae07007399d8838dea5f44b3d9cf3603abc3 tree 4339d2d3aa0e80bc81ac0cd8ca3b7c89486b2150 parent 64dda666c087b6e537892ac9984aff57d2b32c47 author Sam Ravnborg <sam@mars.(none)> Sun, 07 Aug 2005
2007 Aug 12
4
Date and Time validator, updater
Can someone point me to a date/time validator or updater. I have an event start datetime and an event end datetime. I want to validate that the end datetime is after the start datetime. Figure there is some code or library out there already, if you know one, please forward it. Thank you! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2008 Oct 19
2
definition of "dffits"
R-users E-mail: r-help@r-project.org Hi! R-users. I am just wondering what the definition of "dffits" in R language is. Let me show you an simple example. function() { library(MASS) xx <- c(1,2,3,4,5) yy <- c(1,3,4,2,4) data1 <- data.frame(x=xx, y=yy) lm.out <- lm(y~., data=data1, x=T) lev1 <- lm.influence(lm.out)$hat sig1 <-
2009 Mar 02
1
initial gradient and vmmin not finite
Dear Rhelpers I have the problem with initial values, could you please tell me how to solve it? Thank you June > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2))) Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, : NA in the initial gradient > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2),method="BFGS")) Error in optim(start, func, gr =
2005 Oct 28
4
find_by_sql column types
Hello-- There must be a better way to do this. I have a class method in my model that finds averages and does a few calculations using find_by_sql. The problem I¹m encountering is that all computed columns from MySQL come back as type string. E.g., def self.find_averages(domain_id) if @@domain_average return @@domain_average else @@domain_average =
2009 Jan 28
3
initial value in 'vmmin' is not finite
Dear r helpers I run the following code for nested logit and got a message that Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite What does this mean? and how can I correct it? Thank you June > yogurt = read.table("yogurtnp.csv", header=F,sep=",")> attach(yogurt)>
2020 Mar 28
0
[klibc:update-dash] Implement stpcpy() and stpncpy()
Commit-ID: 89742f0fc6f93a4a748ab783856a9d441511b808 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=89742f0fc6f93a4a748ab783856a9d441511b808 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 28 Mar 2020 21:04:54 +0000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:12 +0000 [klibc] Implement stpcpy() and
2011 May 23
1
More relevance for recent documents
Good afternoon I would like to ask if is possible somehow give more relevance to the recent documents in search results. I dont want to sort results according to the date, I still prefer relevance, but I would like to see recent documents with better scoring. I was trying to add search query using AND_MAYBE, which should use relevance from both subqueries, but it didnt add any benefit to the