Here you can find the source of getLastDayOfWeek(Calendar cal)
public static int getLastDayOfWeek(Calendar cal)
//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; } }