tmp.getDate());
final int startWeekDay = getDateTimeService().getStartWeekDay(
- focusedDate);
- final Date curr = (Date) focusedDate.clone();
+ displayedMonth);
+ final Date curr = (Date) displayedMonth.clone();
// Start from the first day of the week that at least partially belongs
// to the current month
- curr.setDate(-startWeekDay);
+ curr.setDate(1 - startWeekDay);
// No month has more than 6 weeks so 6 is a safe maximum for rows.
for (int weekOfMonth = 1; weekOfMonth < 7; weekOfMonth++) {
day.addStyleDependentName(CN_FOCUSED);
}
}
- if (curr.getMonth() != focusedDate.getMonth()) {
+ if (curr.getMonth() != displayedMonth.getMonth()) {
day.addStyleDependentName(CN_OFFMONTH);
}