File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
app/src/main/java/org/fossasia/openevent/general Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ class EventsViewModel(
52
52
mutableShowShimmerEvents.value = false
53
53
lastSearch = mutableSavedLocation.value ? : " "
54
54
}.subscribe({
55
- mutableEvents.value = it
55
+ mutableEvents.value = it.filter {
56
+ EventUtils .getTimeInMilliSeconds(it.endsAt, null ) > System .currentTimeMillis()
57
+ }
56
58
}, {
57
59
Timber .e(it, " Error fetching events" )
58
60
mutableError.value = resource.getString(R .string.error_fetching_events_message)
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import org.fossasia.openevent.general.data.Preference
14
14
import org.fossasia.openevent.general.data.Resource
15
15
import org.fossasia.openevent.general.event.Event
16
16
import org.fossasia.openevent.general.event.EventService
17
+ import org.fossasia.openevent.general.event.EventUtils
17
18
import org.fossasia.openevent.general.event.types.EventType
18
19
import org.fossasia.openevent.general.utils.DateTimeUtils.getNextDate
19
20
import org.fossasia.openevent.general.utils.DateTimeUtils.getNextMonth
@@ -280,7 +281,9 @@ class SearchViewModel(
280
281
mutableShowShimmerResults.value = false
281
282
mutableChipClickable.value = true
282
283
}.subscribe({
283
- mutableEvents.value = it
284
+ mutableEvents.value = it.filter {
285
+ EventUtils .getTimeInMilliSeconds(it.endsAt, null ) > System .currentTimeMillis()
286
+ }
284
287
}, {
285
288
Timber .e(it, " Error fetching events" )
286
289
mutableError.value = resource.getString(R .string.error_fetching_events_message)
You can’t perform that action at this time.
0 commit comments