Here you can find the source of getCurWeekEnd(String strDate)
public static String getCurWeekEnd(String strDate)
//package com.java2s; //License from project: Apache License import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getCurWeekEnd(String strDate) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.parse(strDate, new ParsePosition(0)); Calendar calendar = dateFormat.getCalendar(); int day = calendar.get(Calendar.DAY_OF_WEEK); calendar.add(Calendar.DATE, 7 - day); return dateFormat.format(calendar.getTime()); }// www. j a va 2 s. co m }