mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
lets fetch more events at the weekly view, rather than less
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Context
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.WeeklyCalendar
|
import com.simplemobiletools.calendar.pro.interfaces.WeeklyCalendar
|
||||||
import com.simplemobiletools.calendar.pro.models.Event
|
import com.simplemobiletools.calendar.pro.models.Event
|
||||||
|
import com.simplemobiletools.commons.helpers.DAY_SECONDS
|
||||||
import com.simplemobiletools.commons.helpers.WEEK_SECONDS
|
import com.simplemobiletools.commons.helpers.WEEK_SECONDS
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ class WeeklyCalendarImpl(val callback: WeeklyCalendar, val context: Context) {
|
|||||||
|
|
||||||
fun updateWeeklyCalendar(weekStartTS: Long) {
|
fun updateWeeklyCalendar(weekStartTS: Long) {
|
||||||
val endTS = weekStartTS + 2 * WEEK_SECONDS
|
val endTS = weekStartTS + 2 * WEEK_SECONDS
|
||||||
context.eventsHelper.getEvents(weekStartTS, endTS) {
|
context.eventsHelper.getEvents(weekStartTS - DAY_SECONDS, endTS) {
|
||||||
mEvents = it
|
mEvents = it
|
||||||
callback.updateWeeklyCalendar(it)
|
callback.updateWeeklyCalendar(it)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user