|
@@ -90,8 +90,11 @@ public class DatesUtil {
|
90
|
90
|
Calendar calendar = Calendar.getInstance();
|
91
|
91
|
calendar.setTime(date);
|
92
|
92
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
|
93
|
+ if (dayOfWeek == 0) {
|
|
94
|
+ dayOfWeek = 7;
|
|
95
|
+ }
|
93
|
96
|
int offset = 0 == option ? 1 - dayOfWeek : 7 - dayOfWeek;
|
94
|
|
- int amount = 0 == option ? offset - (n - 1 + k) * 7 : offset - k * 7;
|
|
97
|
+ int amount = 0 == option ? offset - (n - 1 + k) * 7 : offset - k * 7;
|
95
|
98
|
calendar.add(Calendar.DATE, amount);
|
96
|
99
|
return sdf.format(calendar.getTime());
|
97
|
100
|
}
|