String[] arrDate = new String[7];
String[] arrWeek = new String[7];
int mondayPlus = 0;
Calendar cd = Calendar.getInstance();
// 获得今天是一周的第几天,星期日是第一天,星期二是第二天......
int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; // 因为按中国礼拜一
if (dayOfWeek == 1) {
mondayPlus = 0;
} else {
mondayPlus = 1 - dayOfWeek;
}
for(int i=0; i<7; i++) {
GregorianCalendar currentDate = new GregorianCalendar();
currentDate.add(GregorianCalendar.DATE, mondayPlus + 6 + i);
Date monday = currentDate.getTime();
//DateFormat df = DateFormat.getDateInstance();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd EE");
String preMonday = df.format(monday);
String[] strArr = preMonday.split(" ");
//存放日期
arrDate[i] = strArr[0];
//存放周几
arrWeek[i] = strArr[1];
System.out.println(arrDate[i]+","+arrWeek[i]);
}