Here you can find the source of getEndOfWeek(Calendar cal)
public static Calendar getEndOfWeek(Calendar cal)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**/* www.j av a 2 s. c o m*/ * Moves a calendar to the end of the week * * @return calendar passed in, moved to the end of the week */ public static Calendar getEndOfWeek(Calendar cal) { cal.add(Calendar.DAY_OF_WEEK, cal.getActualMaximum(Calendar.DAY_OF_WEEK) - cal.get(Calendar.DAY_OF_WEEK)); return cal; } }