I have a field in the db where it stores stuff like 1st Mondays, 2nd
Wednesdays, etc...I never did take into account a weekly event or the last
<insert day> of the month.  Always meant to do so, but never got around to
it.  Anyhow...with that info, you can base you calc of the numeric day of
week based off of the first day of the week to come up with the actual date.
One way would be to go through the db and look for dates within the
appropriate time frame and them load them into an array and use the array to
populate the calendar.  I use a table to display the calendar.  I assign the
first element of the array to the fist data cell of the table(ie the first
row, Sunday).  If the 1st day of the month is on a Tuesday, Sunday would
have a date value of -1 and Monday would have value of 0.  I first check to
see if the value is gt 0 and then that is where I start numbering and
filling in data.  I also predetermine the dates for the 1st Mondays, etc by
creating constants the value of the appropriate day of the month.  So if the
1st Sunday is the 2nd, sun1=2....  I basically took into account 1st, 2nd,
3rd, 4th, and if appropriate...5th <day> of the month.

Eric 

-----Original Message-----
From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 08 August 2006 20:55
To: CF-Talk
Subject: Re: Calendars

How do you handle recurring events?  Such as if something happens every
monday for a month and the user wants to run a update on all occurences.
The system I am working with was originally designed by someone else and his
method was to put in the first events ID as a lookup ID on all those others.
It seems to be working so far.  I'd be really curious how Yahoo or one of
the other big online calendar systems stores its data.

On 8/8/06, Denny Valliant <[EMAIL PROTECTED]> wrote:
>
> I collect a start and end date from the user, and then create date 
> entries for each day (start datetime, end datetime) in between in a 
> separate table.
>
> Seems like a lot of overhead, but has ended up being very handy.
> :D
>
> On 8/8/06, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> >
> > This is what I do except in my query I use SQL to determine the 
> > number
> of
> > days for the event instead of storing them in a separate column.  
> > Could just as easily use CF to figure it out since you will more 
> > than likely have a start and end date for the event.
> >
> > On 8/8/06, Eric Roberts <[EMAIL PROTECTED]> wrote:
> > >
> > > If you have a 3 day event and you know it starts on the first, 
> > > then
> you
> > > also
> > > know that it is on the 2nd and third.  What you do is you just 
> > > need
> the
> > > start date and the number of days and calculate from there.  If 
> > > you
> are
> > > pulling this from a db...have every entry have a number of days field.
> > >
> > > Eric
> > >
>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:249389
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to