Java Calendar Week getLastDayOfWeek(Calendar cal)

Here you can find the source of getLastDayOfWeek(Calendar cal)

Description

get Last Day Of Week

License

Open Source License

Declaration

public static int getLastDayOfWeek(Calendar cal) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004, 2009 Tasktop Technologies and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from  w  w w  . ja  va  2s.com
 *     Tasktop Technologies - initial API and implementation
 *******************************************************************************/

import java.util.Calendar;

public class Main {
    public static int getLastDayOfWeek(Calendar cal) {
        int last = cal.getFirstDayOfWeek() - 1;

        if (last == 0) {
            last = Calendar.SATURDAY;
        }

        return last;
    }
}

Related

  1. getFirstDateInMonthForDayOfWeek(Calendar cal, final int dayOfWeek)
  2. getFirstDayOfWeek(Calendar cal)
  3. getFirstDayOfWeek(Calendar calendar)
  4. getFirstOfMonthDayOfWeek(GregorianCalendar aCalendar)
  5. getImmediateDayOfWeek(Calendar current, int dayOfWeek)
  6. getLastDayOfWeek(Calendar cal)
  7. getWeek(Calendar calendar)
  8. getWeekDay(Calendar cal)
  9. getWeekdayPosition(Calendar jCalendar)