I know you have an answer but I thought someone would have suggested
<!--- CF_CalcWeek v1.0 was written by Cory Aiken of CF_WebApps
(http://www.cfwebapps.com)
All Rights Reserved
This is freeware, and NO warranties are expressed or implied.
Code is PUBLIC DOMAIN, free to use and modify as desired. Neither
the Author,
nor Allaire Corp., or any other agencies or companies or families or
friends or pets affiliated with the Author or Allaire Corp., are
responsible
for any use or misuse of this code, nor are they liable for any Bad
Stuff that
may happen by one using it. No technical support will be provided
by the Author or Allaire Corp.
Description:
This tag calculates the date of the starting day and ending day
of the week based on a date you pass. You can set any day of the
week
as the starting day and the same with the ending day based on each
day's
ordinal number. (eg. Sunday =1, Monday =2) If you set the beginning
day
of the week later than the ending day then the end day is advanced
one week.
(For example: If I set the start of a week to be Friday and the end
of the
week to be Monday then the Monday returned will be the following
Monday, not
a date earlier than the start.) Also if the start day is later than
the end
day and the date to be checked does not fall between the two ordinal
days, the
values returned will be for the next "week period." Default
BeginDay and EndDay
is Sunday (1) and Saturday (7).
USE: To call this tag
<CF_weekcalc
CheckDate="#Date#"
BeginDay="#OrdinalBeginDay#"
EndDay="#OrdinalEndDay">
Values Returned: #StartWeek# and #EndWeek#
CheckDate is Required, BeginDay and EndDay are optional.
Cold Fusion date functions should be used to correctly display these values
--->
<CFPARAM NAME="Attributes.BeginDay" DEFAULT="1">
<CFPARAM NAME="Attributes.EndDay" DEFAULT="7">
Custom Tag:
<!--- CF_CalcWeek v1.0 was written by Cory Aiken of CF_WebApps
(http://www.cfwebapps.com)
All Rights Reserved
This is freeware, and NO warranties are expressed or implied.
Code is PUBLIC DOMAIN, free to use and modify as desired. Neither
the Author,
nor Allaire Corp., or any other agencies or companies or families or
friends or pets affiliated with the Author or Allaire Corp., are
responsible
for any use or misuse of this code, nor are they liable for any Bad
Stuff that
may happen by one using it. No technical support will be provided
by the Author or Allaire Corp.
Description:
This tag calculates the date of the starting day and ending day
of the week based on a date you pass. You can set any day of the
week
as the starting day and the same with the ending day based on each
day's
ordinal number. (eg. Sunday =1, Monday =2) If you set the beginning
day
of the week later than the ending day then the end day is advanced
one week.
(For example: If I set the start of a week to be Friday and the end
of the
week to be Monday then the Monday returned will be the following
Monday, not
a date earlier than the start.) Also if the start day is later than
the end
day and the date to be checked does not fall between the two ordinal
days, the
values returned will be for the next "week period." Default
BeginDay and EndDay
is Sunday (1) and Saturday (7).
USE: To call this tag
<CF_weekcalc
CheckDate="#Date#"
BeginDay="#OrdinalBeginDay#"
EndDay="#OrdinalEndDay">
Values Returned: #StartWeek# and #EndWeek#
CheckDate is Required, BeginDay and EndDay are optional.
Cold Fusion date functions should be used to correctly display these values
--->
<CFPARAM NAME="Attributes.BeginDay" DEFAULT="1">
<CFPARAM NAME="Attributes.EndDay" DEFAULT="7">
<CFIF #Attributes.CheckDate# NEQ "">
<!--- Determine what day (ordinal number) of the week is submitted
--->
<CFSET DayOrdinal = #DayofWeek(Attributes.CheckDate)#>
<!--- Set the StartWeek and EndWeek variables based on DayOrdinal
--->
<CFIF #Attributes.BeginDay# GT #Attributes.EndDay#>
<cfif #DayofWeek(Attributes.CheckDate)# LTE
#Attributes.EndDay#>
<CFSET Attributes.BeginDay = #Attributes.BeginDay#
-7>
<cfset Attributes.EndDay = #Attributes.EndDay# - 7>
</cfif>
<cfset Attributes.EndDay = #Attributes.EndDay# + 7>
</cfif>
<CFSET Caller.StartWeek = ((#Attributes.CheckDate#) -
(#DayOrdinal#-#Attributes.BeginDay#))>
<CFSET Caller.EndWeek = ((#Attributes.CheckDate#) +
(#Attributes.EndDay#-#DayOrdinal#))>
<cfelse>
<!--- Enter any failure messages/events here --->
You must enter a date to check.
</cfif>
> -----Original Message-----
> From: Yvette Ingram [SMTP:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 4:16 PM
> To: CF-Talk
> Subject: Re: Date/Time Nightmare
>
> Jim:
>
> Thanks. That adds 3/25/01 to the list. I just want the current week from
> 3/18/01 to 3/24/01. I know it's probably simple to get this, but at the
> moment I'm not seeing it.
>
> {ts '2001-03-18 17:13:08'}
> {ts '2001-03-19 17:13:08'}
> {ts '2001-03-20 17:13:08'}
> {ts '2001-03-21 17:13:08'}
> {ts '2001-03-22 17:13:08'}
> {ts '2001-03-23 17:13:08'}
> {ts '2001-03-24 17:13:08'}
> {ts '2001-03-25 17:13:08'}
>
> Yvette Ingram
> Brainbench Certified ColdFusion 4.5 Programmer
> Email: ingramrecruiting@erols or
> [EMAIL PROTECTED]
> ICQ: 21200397
>
>
> ----- Original Message -----
> From: "Jim McAtee" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Sunday, March 18, 2001 4:52 PM
> Subject: Re: Date/Time Nightmare
>
>
> > <cfloop index="ii" from="0" to="6">
> >
> >
> >
> > ----- Original Message -----
> > From: "Yvette Ingram" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Sunday, March 18, 2001 2:50 PM
> > Subject: Date/Time Nightmare
> >
> >
> > > hello,
> > >
> > > I "REALLY" need help on this.
> > >
> > > Here's the problem:
> > >
> > > The Code:
> > > <cfset startweek_dt = #Now()#>
> > > <cfloop index="ii" from="1" to="6">
> > > <cfset startweek_dt = DateAdd('d',1, startweek_dt)>
> > > <cfoutput>#startweek_dt#</cfoutput><br>
> > > </cfloop>
> > >
> > > Produces this:
> > > {ts '2001-03-19 16:39:43'}
> > > {ts '2001-03-20 16:39:43'}
> > > {ts '2001-03-21 16:39:43'}
> > > {ts '2001-03-22 16:39:43'}
> > > {ts '2001-03-23 16:39:43'}
> > > {ts '2001-03-24 16:39:43'}
> > >
> > > I can't get 3/18/01 through 3/24/01 passed correct through the select
> box.
> > > Can I or how do accomplish this.
> > >
> > >
> > > Yvette Ingram
> > > Brainbench Certified ColdFusion 4.5 Programmer
> > > Email: ingramrecruiting@erols or
> > > [EMAIL PROTECTED]
> > > ICQ: 21200397
> > >
> > >
> > >
> > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists