Java Calendar Week lastDayOfWeek(Calendar calendar)

Here you can find the source of lastDayOfWeek(Calendar calendar)

Description

last Day Of Week

License

Apache License

Declaration

public static final Calendar lastDayOfWeek(Calendar calendar) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {

    public static final Calendar lastDayOfWeek(Calendar calendar) {
        Calendar cal = (Calendar) calendar.clone();
        int day = cal.get(Calendar.DAY_OF_YEAR);

        while (cal.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY) {
            cal.set(Calendar.DAY_OF_YEAR, ++day);
        }//  w  ww  . j av a 2s .co  m

        return cal;
    }
}

Related

  1. isWeekday(Calendar cal)
  2. isWeekEnd(Calendar c)
  3. isWeekend(Calendar cal)
  4. isWeekend(GregorianCalendar date)
  5. lastDayOfWeek(Calendar cal)
  6. setStartOfWeek(Calendar date)
  7. setTimeAsFirstDayOfWeek(Calendar calendar)
  8. truncateToWeek(GregorianCalendar date)
  9. weekDay(Calendar date)