lets fetch more events at the weekly view, rather than less

This commit is contained in:
tibbi 2020-11-02 20:10:25 +01:00
parent 0c04f8ddc6
commit 098b945b55

View file

@ -4,6 +4,7 @@ import android.content.Context
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.interfaces.WeeklyCalendar
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.commons.helpers.DAY_SECONDS
import com.simplemobiletools.commons.helpers.WEEK_SECONDS
import java.util.*
@ -12,7 +13,7 @@ class WeeklyCalendarImpl(val callback: WeeklyCalendar, val context: Context) {
fun updateWeeklyCalendar(weekStartTS: Long) {
val endTS = weekStartTS + 2 * WEEK_SECONDS
context.eventsHelper.getEvents(weekStartTS, endTS) {
context.eventsHelper.getEvents(weekStartTS - DAY_SECONDS, endTS) {
mEvents = it
callback.updateWeeklyCalendar(it)
}