diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-04-11 00:55:26 -0500 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-04-11 00:55:26 -0500 |
commit | 546738888395565ac2d5fe2cfb941ecdd0c1df45 (patch) | |
tree | 7f9646939b65dfbb97f0724c66d7a81e9bd5a23a /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers | |
parent | a6a95167dbfe48fa0c5d6b61219309d346142979 (diff) | |
download | etbsa-trackermap-mobile-546738888395565ac2d5fe2cfb941ecdd0c1df45.tar.gz etbsa-trackermap-mobile-546738888395565ac2d5fe2cfb941ecdd0c1df45.tar.bz2 etbsa-trackermap-mobile-546738888395565ac2d5fe2cfb941ecdd0c1df45.zip |
- [shared] Added DateUtils 'expect' class for platform-specific date format.
- [android] Redesigned reports view, now supports custom reports!
- [ios] Not rewritten yet, it won't build!
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt index e120e97..bc0a48f 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt @@ -60,18 +60,17 @@ class ReportController( return } - val (currentDate, previousDate) = reportPeriod.getDates() + val (from, to) = reportPeriod.getStringDates() if (!xlsx) { reportFlow.value = Report.LoadingReport } - // GlobalScope.launch { - when (reportType) { - ReportType.POSITIONS -> fetchPositions(deviceId, previousDate, currentDate, xlsx) - ReportType.EVENTS -> fetchEvents(deviceId, previousDate, currentDate, eventTypes, xlsx) - ReportType.STOPS -> fetchStops(deviceId, previousDate, currentDate, xlsx) - } - // } + + when (reportType) { + ReportType.POSITIONS -> fetchPositions(deviceId, from, to, xlsx) + ReportType.EVENTS -> fetchEvents(deviceId, from, to, eventTypes, xlsx) + ReportType.STOPS -> fetchStops(deviceId, from, to, xlsx) + } } private suspend fun fetchPositions( |