I want to calculate Saturday's and Sunday's in a date range? How can i ?
iterate in days and so :
Calendar date ;//initiate with your date
int day = date.get(Calendar.DAY_OF_WEEK); // 1=Sunday , 2=Monday , ...
check the day:
if(day == 1 || day == 7)
{
//add to your list this **date** (for example List<Calender>
}
and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With