Skip to main content
Inspiring
March 11, 2010
Question

Need to display days for every "X" weeks

  • March 11, 2010
  • 1 reply
  • 515 views

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

This topic has been closed for replies.

1 reply

BalanceAuthor
Inspiring
March 22, 2010

Anyone have any thoughts on this?

Thanks

ilssac
Inspiring
March 22, 2010

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.