set minimum event time to a month ago

This commit is contained in:
tibbi 2017-01-30 21:23:56 +01:00
parent 04b389b46c
commit eba27b2541

View File

@ -35,7 +35,7 @@ class FetchGoogleEventsTask(val activity: Activity, credential: GoogleAccountCre
}
private fun getDataFromApi(): List<Event> {
val now = DateTime(System.currentTimeMillis())
val now = DateTime(System.currentTimeMillis() - getMonthMillis())
val events = service.events().list("primary")
.setMaxResults(10)
.setTimeMin(now)
@ -53,4 +53,6 @@ class FetchGoogleEventsTask(val activity: Activity, credential: GoogleAccountCre
}
}
}
private fun getMonthMillis() = 30 * 24 * 60 * 60 * 1000L
}