You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Calendar calendar = new Calendar();
2.1. calendar.addAppointment(appt);
2.2. calendar.addAppointment(appt);
..............
2.xxx. calendar.addAppointment(appt);
3. calendar.setView(CalendarViews.MONTH);
What is the expected output? What do you see instead?
In month view I expect to see all appointment for the month. Appointments
have to be placed in the good day of the month.
Instead we can see that for some days in the month, we have appointments
from last month (for exemple, in the 3 december panel, I can find
appointments from 26 november.
I find the problem :
It's because in MonthLayoutDescription in the method calculateWeekFor, we
calculate the difference in week between testDate and calendarFirstDate...
but the code don't care about negative or positive difference. So for my
exemple, there is 4 days difference between 30 november (first day in
month) and 26 november. And appointments for 26 november are diplay in the
4th day in the first week!
So I do this stuff in MonthLayoutDescription class to resolve the problem:
private int calculateWeekFor(Date testDate, Date calendarFirstDate) {
/*this test to get out every dates before calendarFirstDate*/
if (testDate.before(calendarFirstDate)){
return -1;
}
int endWeek = (int) Math
.floor(DateUtils.differenceInDays(testDate, calendarFirstDate) /
7d);
return Math.min(endWeek, weeks.length - 1);
}
What version of the product are you using? On what operating system?
Latest from repository
Please provide any additional information below.
I hope that it can be usefull for you! Thank you for this API, it's perfect
for me, and... very good job!
Best regards!
Zinou
Original issue reported on code.google.com by kevinher...@gmail.com on 25 Mar 2010 at 2:20
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
kevinher...@gmail.com
on 25 Mar 2010 at 2:20The text was updated successfully, but these errors were encountered: