Quivr / Android-Week-View

Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Apache License 2.0
258 stars 64 forks source link

Bug: adding full day WeekViewEvent with same startDate and endDate results in single cell #106

Closed AndroidDeveloperLB closed 6 years ago

AndroidDeveloperLB commented 6 years ago

I think I've found an issue in your fork (and the others) :

if I add 2 all-day events with the exact same start&end dates, I see a single event instead. Here's the code to test it in AsynchronousActivity :

@Override
public void success(List<Event> events, Response response) {
    this.events.clear();
    if (!events.isEmpty()) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Calendar cal2 = (Calendar) cal.clone();
        cal2.add(Calendar.MINUTE, 1);
        for (int i = 0; i <= 1; ++i) {
            WeekViewEvent event = new WeekViewEvent(Integer.toString(i), "event:" + Integer.toString(i), null, cal, cal2, true);
            event.setColor(0xffff0000);
            this.events.add(event);
        }
    }
    getWeekView().notifyDatasetChanged();
}

image

AndroidDeveloperLB commented 6 years ago

ok fixed it: https://github.com/Quivr/Android-Week-View/pull/97

https://github.com/Quivr/Android-Week-View/pull/97/commits/0be8d77d549a3eecba0f4fc9d3dda8949f2daf61