sorry ... my bad ...
<CFSET diff = 2 - dayofweek(now())>
<CFIF diff is 1><CFSET diff = - 6></CFIF>
<CFSET monday = dateadd("d", diff, date)>
that's should work .... have to make sure that it goes 6 days back if the
current day is sunday, since you need that to be the last day of the week
Allan
-----Original Message-----
From: Allan Pichler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 6:41 PM
To: CF-Talk
Subject: RE: How can I find the date of the monday of the week
containing a given date?
this should do the trick
<CFSET monday = dateadd("d", ( evaluate( - (dayofweek(date) - 2))), now())>
Sets monday to the last based on todays date!
Allan
-----Original Message-----
From: Brent Goldman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 6:29 PM
To: CF-Talk
Subject: How can I find the date of the monday of the week containing a
given date?
Hello,
I am currently writing an online scheduling application with ColdFusion. At
one part of the program, I output the next four weeks in case the user wants
to quickly jump ahead in time. Rather than outputting weeks starting from
the current day, such as from a Tuesday like today, I want the weeks
starting from a Monday. So today's week would be Dec 18 (Mon) - Dec 24
(Sun), not Dec 19 (Tue) - Dec 25 (Mon).
I've looked at all of the ColdFusion date functions, but I can't figure out
how to use them to retrieve the date of the Monday of the week containing a
given date. Does anyone know how to do this? Someone please help.
Thanks,
Brent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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