> 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,weekstart),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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to