• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need to display days for every "X" weeks

Explorer ,
Mar 11, 2010 Mar 11, 2010

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

TOPICS
Advanced techniques

Views

418

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 22, 2010 Mar 22, 2010

Copy link to clipboard

Copied

Anyone have any thoughts on this?

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 22, 2010 Mar 22, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 22, 2010 Mar 22, 2010

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation