Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong display of appointments in month view #40

Closed
GoogleCodeExporter opened this issue Apr 13, 2016 · 4 comments
Closed

Wrong display of appointments in month view #40

GoogleCodeExporter opened this issue Apr 13, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

Original comment by Brad.Ryd...@gmail.com on 30 Mar 2010 at 12:52

  • Changed state: Accepted
  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Marking as critical - i'd like to resolve prior to 0.9 final version

Original comment by Brad.Ryd...@gmail.com on 21 Apr 2010 at 8:50

  • Added labels: Priority-Critical
  • Removed labels: Priority-High

@GoogleCodeExporter
Copy link
Author

I have started working on this issue. I am planning to have a fix by May 2nd, 
2010. 

Original comment by carlos.m...@gmail.com on 29 Apr 2010 at 3:46

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

This item has been fixed and uploaded to trunk

Original comment by Brad.Ryd...@gmail.com on 12 May 2010 at 3:08

  • Changed state: Fixed
  • Added labels: Release0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant