Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<cfparam name="url.datedistance" default="0">
<Cfset to_day=DayOfWeek(Now())>
<!--- If today is not Sunday (1) subtract the difference between what day it is, and 1 --->
<cfif to_day gt 1>
<cfset to_diff=to_day-1>
<cfset to_date=DateAdd("d",-#to_diff#,Now())>
<cfelse>
<cfset to_date=Now())>
</cfif>
And then you query would look like..
<cfquery...>
select * from Tracker
where tDate > #dateAdd(to_date,0-(7+(#url.datedistance#*7)),Now())#
and tDate < #dateAdd(to_date,0-(#url.datedistance#*7),Now())#
</cfquery>
<cfparam name="url.datedistance" default="-1">
<Cfset to_day=DayOfWeek(Now())>
<!--- If today is not Sunday (1) subtract the difference between what day it is, and 1 --->
<cfif to_day gt 1>
<cfset to_diff=to_day-1>
<cfset to_date=DateAdd("d",-#to_diff#,Now())>
<cfelse>
<cfset to_date=Now()>
</cfif>
<cfset to_date = DateAdd("ww", url.datedistance, to_date)>
<cfset dfmt = "mm/dd/yy">
<cfoutput>
#Dateformat(dateadd("d",0,to_date),dfmt)# -
#Dateformat(dateadd("d",6,to_date),dfmt)#
</cfoutput>