Perhaps I'm too newbie-ish for what you've described below.

It's not working for me; it displays only the code in the drop down.

I'd like to display [current week:  Mon 10/27 - Sun 11/3]  (minus the
current week:) in the drop down.  Then, I'd like to display all previous
weeks back to a "start date" that I'll need to define elsewhere.

Sorry if I'm confusing the issue; it's certainly a mindbender for me.

Thanks again,

Russ

> -----Original Message-----
> From: S. Isaac Dealey [mailto:info@;turnkey.to] 
> Sent: Sunday, October 27, 2002 5:53 PM
> To: CF-Talk
> Subject: Re: Date - Weekly Format?
> 
> 
> > I'm attempting to populate a dropdown with weekly options (10/28 - 
> > 11/3, 11/4 - 11/10, etc.) and go back to a pre-defined date (by
> > me), selected
> > on the current week, and then show 2-ish weeks into the
> > future.
> 
> > Is there a way that CF will intuitively work with this through the 
> > Date mask?
> 
> > Thanks in advance,
> 
> afaik you'd have to loop it...
> 
> <cfset dfmt = "mm/dd">
> <cfloop index="x" from="7" to="21" step="7">
>       <option 
> value="">#Dateformat(dateadd("d",x,now()),dfmt)#-#Dateformat(datead
> d("d",x+6,now()),dfmt)#</option>
> </cfloop>
> 
> You could use a UDF to encapsulate this tho -- probably not a 
> bad idea assuming you're using CF 5+
> 
> function weekformat(weekstart) {
>       var dfmt = "mm/dd";
>       return 
> "#dateformat(weekstart,dfmt)#-#dateformat(dateadd("d",6,weekst
> art),dfmt)#";
> }
> 
> Then
> 
> <cfloop index="x" from="7" to="21" step="7">
>       <option value="">#weekformat(dateadd("d",x,now()))#</option>
> </cfloop>
> 
> hth
> 
> Isaac
> Certified Advanced ColdFusion 5 Developer
> 
www.turnkey.to
954-776-0046


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to