Here you can find the source of getLastDayOfTheWeek(Date date)
public static Date getLastDayOfTheWeek(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.Locale; public class Main { private static final int HOURS_OF_DAY = 23; public static Date getLastDayOfTheWeek(Date date) { Calendar calendar = Calendar.getInstance(Locale.CHINA); calendar.setTimeInMillis(date.getTime()); calendar.set(Calendar.DAY_OF_WEEK, 7); calendar.set(Calendar.HOUR_OF_DAY, HOURS_OF_DAY); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); return new Date(calendar.getTimeInMillis()); }/*ww w . j a v a 2s . c o m*/ }