I don't know if this will help you or not.  I have a calendar application that uses this script/


<!--- Set Date parameters used in the where clause of the query --->
<cfscript>
firstOfMonth = CreateDate(year,month,1);
endOfMonth = CreateDate(year,month,DaysInMonth(firstOfMonth));
startday = 2; //1=Sunday, 2=Monday, ..., 7=Saturday

//calculate first day of calendar display.
daynum = DayOfWeek(firstOfMonth);
if (daynum - (startday - 1) LT 1)
  offset = 7 + (daynum - (startday - 1));
else
  offset = (daynum - (startday - 1));
  
firstDay = DateAdd("d",-(offset-1),firstOfMonth);

//calculate last day of calendar dispay
daynum = DayOfWeek(endOfMonth);
if (daynum - (startday - 1) LT 1)
  offset = -(daynum - (startday - 1));
else
  offset = 7 - (daynum - (startday - 1));
  
lastDay = DateAdd("d",offset,endOfMonth);
</cfscript>


Now this does not display blanks at the beginning and end.  It displays records for the days of the previous month and next month.  For example:
This month it goes: Mon Apr 26|Tue Apr 27|Wed Apr 28|Thu Apr 29|Fri Apr 30|Sat May 1{Sun May 2


...


Mon May 31|Tue Jun 1|Wed Jun 2|Thu Jun 3|Fri Jun 4|Sat Jun 5|Sun Jun 6


HTH


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

"C code. C code run. Run code run. Please!"
     - Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to