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

Event not drawing on 31st day of month #107

Open AmritaTakken opened 6 years ago

SkyleKayma commented 6 years ago

Some code are needed. We can't help you here. Add more context to your request.

yashpalraj commented 6 years ago

Replace below Function In MonthLoader

@Override
public double toWeekViewPeriodIndex(Calendar instance){
    return instance.get(Calendar.YEAR) * 12 + instance.get(Calendar.MONTH) + (instance.get(Calendar.DAY_OF_MONTH) - 1) / 30.0;
}

With

@Override
public double toWeekViewPeriodIndex(Calendar instance){
    return instance.get(Calendar.YEAR) * 12 + instance.get(Calendar.MONTH) + (instance.get(Calendar.DAY_OF_MONTH) - 1) / instance.get(Calendar.DAY_OF_MONTH);
}

Due to "30.0" value data was not displayed on the 31st day of the month.