search for: startdate

Displaying 20 results from an estimated 88 matches for "startdate".

2006 May 07
1
Anyone care for a braindump?
I have this problem with records that have to be alligned on end- and startdate. I came up with the following. but am not convinced that this is the best way to tackle this problem. Anyone care for a braindump? def head_to_tail # Remove days that have startdate >= self.startdate AND enddate <= self.enddate # # before after # # |==...
2008 Feb 27
2
All Day Events
...se this cannot be this hard. I''m trying to build an all day calendar event. In most clients it shows up as an entry at the top of the day rather than blocking out the whole day with an event. I have a bit of code that looks like this... cal.event do dtstart DateTime.parse("#{startDate.year()}-#{startDate.month()}-#{startDate.day()}") dtend DateTime.parse("#{startDate.year()}-#{startDate.month()}-#{startDate.day()+1}") end The ICAL entry from this looks like... DTSTART: 20080114T000000 DTEND: 20080115T000000 I also tried it in the format from the READ...
2006 Feb 08
6
can''t get date_select to work
...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 name="booking[startdate(1i)]">... <select name="booking[startdate(2i)]">... <select name="booking[startdate(3i)]">... In the view controller method I create a booking object and set startdate to Date.today+1,...
2012 Nov 02
2
Date format conversion from "2012-09-20" to "2012:09:20"
Hi R, How to get the range of values form startDate to lastDate as given below?. #***************************************************************** # Load historical data #****************************************************************** library('quantmod') endDate =Sys.Date() startDate = as.Date(endDate-30, order="ymd") datasp...
2006 Jul 26
8
change text_field_tag class
in my booking / _form I have the following input fields : (startdate and endate) <div> <label for="startdate">Booking Start Date</label><br /> <%= text_field_tag(''startdate'', @startdate, {:class => @startdateclass, :readonly => "readonly", :maxlength => "25"} ) %> <%= obser...
2006 Jul 06
3
Understanding date_select naming conventions
I am using the date_select helper to generate date select elements in a form. I notice that the generated HTML shows that these selects have the following names: Month: current_job[StartDate(2i)] Day: current_job[StartDate(3i)] Year: current_job[StartDate(1i)] I''m assuming that the Xi identifiers somehow specify the appropriate date part from a date or time value. Can anyone shed some light on how this works? Where can I get definite info. on it? Also, I am using sele...
2006 Apr 25
1
Array of dates/times from time.now till nextweek
Hi, I would like to make @dates in my controller. I tried the following: startdate = Time.now enddate = startdate.next_week for enddate > startdate @dates << startdate startdate = startdate.tomorrow end But I get an errormessage when I check the syntax: "warning: useless use of a variable in void context" Anyone? Thanks! Steven. -- Posted via http:/...
2009 Feb 22
6
CHECK if param exists? please help
hi folks. i want to check if a param exists if not to set it to a default value for my date range filter. in my controller i have: @from_date = Date.strptime(params[:startdate],"%d/%m/%Y") @to_date = Date.strptime(params[:enddate],"%d/%m/%Y") @articles = @results.find(:all, :conditions => [ "created_at >= ? and created_at <=?",@from_date,@to_date], :order => '...
2005 May 31
2
POSIX problem
...ut if I just paste the date and time parts together and try and create the POSIXct object, I have problems. Here is a toy example created from the actual data which caused the problem. I am using R 2.0.1 on Windows XP. > # Data frame with dates and times, as character > PeopleData.df StartDate StartTime 1 29/10/2001 15:26 2 7/12/2001 10:32 3 16/11/2001 13:58 4 28/11/2001 14:00 5 2/11/2001 15:22 6 26/11/2001 11:15 > str(PeopleData.df) `data.frame': 6 obs. of 2 variables: $ StartDate: chr "29/10/2001" "7/12/2001" "16/11/2001&q...
2006 Mar 24
3
Date in dataframe manipulation
Hi, I have a dataframe with many columns, including date and I want to keep only a few of the columns including date column. I used the following command: with(FireDataAppling, cbind(STARTDATE, County, TOTAL, CAUSE) It works, but the date becomes days from Jan 1, 2001. FireDataAppling$STARTDATE[1] gives [1] 2001-01-04 00:00:00 1703 Levels: ......... After the cbind command, the entry becomes a 4. I want to get 2001-01-04. What command should I use? Thank you. Daniel Chan...
2012 Feb 22
4
Week number from a date
Hi My data looks like this startDate="2008-06-01" dateRange =c( "2008-10-01","2008-12-01") Is there any method to find the week number from the startDate range ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.h...
2008 Feb 20
4
plotting every ith data point?
...of points with their confidence intervals (arrows), and even if I specify type="b," the output ends up looking like just a series of crowded points. For example, if you try making the plot below, you will see how crowded two lines look without error bars: > example.df<-data.frame(StartDate=(94:157), DSR1=seq(0.4, 0.8, length.out=64), DSR2=seq(0.3, 0.9, length.out=64)) > plot(example.df$StartDate, example.df$DSR1, type="b", ylim=c(0.3,0.9)) > points(example.df$StartDate, example.df$DSR2, type="b", pch=3) Any ideas for an elegant solution to my dilemma? Than...
2008 Nov 19
2
Exclude holidays in a subset of dates?
...and would like to skip procedures everytime I encounter a weekend or holiday. To do this, I thought the easiest way would be to create a TRUE/FALSE vector corresponding to each day where it is TRUE if a workday, and FALSE if a weekend or holiday. So far I have been able to do this for weekdays: startDate <- as.Date("2008-08-15") endDate <- as.Date("2008-09-15") AllDays <- seq(startDate, endDate, by="day") WorkDays <- ifelse(as.numeric(format(startDate+days-1, "%w"))%%6==0, FALSE, TRUE) But I'm a bit lost as to what to do for the holidays, f...
2012 Jul 11
2
Passing Multiple Variable Into SQLDF Statement as parameters of function
...here is no such column in the dataframe (which is true!). My question is: how can I pass multiple date variables into my sqldf statements? In particular, the sqldf is supposed to read the date parameter as a character string (its the only way I could get it to work). This is my code so far: > StartDate='2010-06-15' > EndDate='2010-06-22' > Example=paste("select * from LibDB where Date_Entered > =",as.character(StartDate)) > sqldf(Example,verbose=TRUE) This passes the StartDate in correctly, but in a form where my particular query won't pick up the date...
2005 May 26
2
warnings from hist(): parameter XXX couldn't be set in high-level plot functionN
...strange warnings from hist(). Example follows. ############################ #Produce a histogram of start dates for a set of field measurements. # I didn't reproduce all the dates, because not sure it's relevant, but here's a sample. # Note the invalid date in the fifth element. > StartDate[sample(1:length(StartDate),20)] [1] "2004-08-26" "1997-09-08" "2004-08-19" "1997-09-08" "0999-07-20" [6] "2001-11-28" "2000-11-02" "1997-09-08" "2004-08-19" "2004-10-28" [11] "1997-09-08"...
2011 Mar 23
1
using R variables in RMySQL query
I have the following function myGetstockdataMySQL <- function(startdate, enddate, ticker) { con <- dbConnect(MySQL(), user="blahblah", password="blahblah", dbname="blahblah", host="localhost") rs <- dbGetQuery(con, "SELECT price.close FROM price INNER JOIN stocks ON stocks.stock_id=price.stock_ID WHERE (price.date_h...
2010 Oct 18
2
VectorComparison
Hi all, I am not exactly fluent in R and I got stuck with this. I would like to compare each elements of a vector A with any of the elements in Vector B. For some reasons it does not work. > StartDate = as.Date("01/10/2007", "%d/%m/%Y") > TimeSpan = seq(StartDate, by = 'days', length = length(myAverageCWVs$X1986)) > TickLabels = c("2007-10-01", "2007-11-01", "2007-12-01", "2008-01-01") > TimeSpan[1:40] == TickLabel...
2005 Jun 01
2
problem with chron scales in lattice
...ere should be year labels from 1992 to 2004 for the x axis in the plot below, but instead only a few of them appear, and in the wrong spots, as if the coordinate system has changed after finishing with the panel function. library(chron) library(lattice) # vertical grid lines at start of each year startdate <- "1/1/1992" enddate <- "1/1/2005" startdatetime <- chron(dates=startdate, times="00:00:00") enddatetime <- chron(dates=enddate, times="00:00:00") x.lines <- as.chron(seq.dates(startdate, enddate, by="years")) x.limits <- c(as.c...
2006 Feb 06
4
Basic MVC in RoR question
Ok, Here''s my controller: def create trainingplan = Trainingplan.createplan(@params[:startdate], @params[:enddate], @params[:hoursperweek], @params[:programtype]) end My model is: class Trainingplan <ActiveRecord::Base def self.createplan(stardate, enddate, hoursperweek, programtype) stardate = startdate enddate = enddate hoursperweek = hoursperweek programtype = pr...
2011 Jan 18
1
Dates when transferred from RExcel to R.
Hi R, The dates when exported from Excel to R by "Put R Var", gives one less day. For example, 1. Let 1/1/2011 be the cell A1 in date format. 2. Right click and select "Put R Var" and give a name to it say, "StartDate" (R in foreground process) 3. In the R console see the value stored in "StartDate" 4. The output is: > StartDate [1] "2010-12-31 23:30:00 IST" Please note that this output is 30 minutes less than the actual date. Why is this? Thanks and Regards, Shu...