Well, this code is fairly bad, I'm sorry, I don't mean to be offensive, I'm just stating the way it is, but for a quick fix try this.
You are currently doing this
for (int iDay2 = 1; iDay2 < 8; iDay2++) {
which is essentially cycling through an array of days organized as
{ Calendar.SUNDAY, Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY }
So, think about it. What do you need to do to change the order of days you are interested in?
Setup an array in the order you want it (the days should still be in the proper order of course) and use that array in the for loop.
Like this:
int[] days = { Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY, Calendar.SUNDAY };
for (int dayIndex = 0; dayIndex < days.length; dayIndex++) {
int iDay2 = days[dayIndex]; Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan