I have an application that asks a user to input a start date. Then the user will go through a series of 5 pages and input data to be exported to an excel sheet with page 1 being on the first block with the date day 2 being on the second block with a incremented date etc etc. Is there a any type of function available to accomplish this or am I doomed to the use of if statements to increment the date correctly. I tried to increment the date by simply returning the date in a series of variables
int day = getIntent().getExtras().getInt("day");
int year = getIntent().getExtras().getInt("year");
String month = getIntent().getStringExtra("month");
String dayofweek = getIntent().getStringExtra("dayofweek");
And the I would output those variables in the appropriate cells for the excel sheet. Monday would be just the variables since thats the start date. Tuesday would be the day + 1. Wednesday would be the day + 1 to continuously increment it to day 5. The problem I ran into is it the start day is selected as the last day of the month it would continue to increment the day ie Jan 31 Jan 32 Jan 33 Jan 34 etc etc. So I have to take the end of the month, end of the year, and leap year in 2016 and 2020 into account. On top of weekends. For example if Tuesday is selected I want the start date to show up on tuesday the fourth date would show up on friday and then the next correct date on monday again.
So I guess the short of it all would be Is there a better way to implement this?