Added opening hours and a button for the user to view them, but the formatting sucks

This commit is contained in:
denizk0461
2023-04-25 16:55:17 +02:00
parent 6b1d77dfb3
commit 65114264c4
13 changed files with 127 additions and 19 deletions
@@ -36,6 +36,13 @@ class CanteenViewModel(app: Application) : AppViewModel(app) {
*/
fun getDates(): List<OfferDate> = returnBlocking { repo.getDates() }
/**
* Retrieves the opening hours of the canteen as a string.
*
* @return opening hours
*/
fun getCanteenOpeningHours(): String = returnBlocking { repo.getCanteenOpeningHours() }
// Fetch the canteen offers asynchronously. Updates will be provided through a LiveData object.
fun fetchOffers(canteen: Int, onRefreshUpdate: (status: Int) -> Unit, onFinish: () -> Unit) {
doAsync { parser.parse(canteen, onRefreshUpdate, onFinish) }