Here you can find the source of getMondayFirstOfWeek(Date baseDate)
public static Date getMondayFirstOfWeek(Date baseDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Date getMondayFirstOfWeek(Date baseDate) { int dayofweek = getDayOfWeekForDate(baseDate); dayofweek = dayofweek == 1 ? dayofweek + 7 : dayofweek; return getDateAfterDays(baseDate, 2 - dayofweek); }/* ww w. j a va 2 s . co m*/ public static int getDayOfWeekForDate(Date day) { Calendar calendar = Calendar.getInstance(); calendar.setTime(day); return calendar.get(Calendar.DAY_OF_WEEK); } public static Date getDateAfterDays(Date date, int add_days) { Calendar time = Calendar.getInstance(); time.setTime(date); time.add(Calendar.DATE, add_days); return time.getTime(); } }