Copy link to clipboard
Copied
I have start and end dates, along with specific days of the week that I'm outputting.
However, I need to display them every "X" week but I'm not sure how to do that.
For example: show Monday, Wednesday, and Friday for every 2 weeks (or every 3, 4,5 weeks).
Can someone shed some light?
TIA
Copy link to clipboard
Copied
Anyone have any thoughts on this?
Thanks
Copy link to clipboard
Copied
Have one loop iterate over the number of weeks you would like to handle.
Have a second loop inside this one loop over the days of the week (1 through 7).
Have some type of branching logic that does something on the days you want and does something else (maybe nothing) on the days you don't. Such as an if/else or maybe a case block.
Copy link to clipboard
Copied
Another option, depending on what you are really trying to do.
Loop from day A to day B.
If current itteration of the day is a designated day of the week [dayOfWeek(currentDay)] do one thing, else do another.
If current itteration of the day is the end of the week [I.E. dayOfWeek(currentDay) is 7] then break the display to a new week.
There are probably other ways to do this as well. The date time functions could probably give you some ideas.
http://livedocs.adobe.com/coldfusion/8/htmldocs/functions-pt0_05.html#1098968