I need to get the date based on the following condition,
From the current date, If the user selects only date(1-31), must subtract it from the current date and get the new date.
If the user selects weeks(1-53) then we have to remove the selected no’of weeks from the current dates no’of weeks and get a new date.
If the user selects only months(1-12) then we have to delete the selected number of months from the current date months and get a new date.
Sample code for date checking..
Calendar today=Calendar.getInstance();
int month=today.MONTH;
int year=today.YEAR;
today.clear();
today.set(year, month,dateOfMonth);
date=today.getTime();
Any Logic is highly appreciated.
Thanks in Advance.
1 Answer