refactor(core, veranstaltung): Exception-Handling vereinfacht und Delay-Angabe optimiert
Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+10
-9
@@ -29,6 +29,7 @@ import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import javax.swing.JFileChooser
|
||||
import javax.swing.filechooser.FileNameExtensionFilter
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@@ -541,12 +542,12 @@ fun VeranstaltungKonfigV2(
|
||||
|
||||
val dateVon = try {
|
||||
LocalDate.parse(von, dateFormatter)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val dateBis = try {
|
||||
LocalDate.parse(bis, dateFormatter)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val today = LocalDate.now()
|
||||
@@ -728,12 +729,12 @@ fun VeranstaltungKonfigV2(
|
||||
2 -> {
|
||||
val dVon = try {
|
||||
LocalDate.parse(von, dateFormatter)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val dBis = try {
|
||||
LocalDate.parse(bis, dateFormatter)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val today2 = LocalDate.now()
|
||||
@@ -1086,12 +1087,12 @@ fun TurnierWizardV2(
|
||||
val vBis = veranstaltung?.datumBis?.let { LocalDate.parse(it) }
|
||||
val tVon = try {
|
||||
LocalDate.parse(von)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val tBis = if (bis.isBlank()) tVon else try {
|
||||
LocalDate.parse(bis)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
|
||||
@@ -1267,7 +1268,7 @@ private fun Step1Basics(
|
||||
CircularProgressIndicator()
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
kotlinx.coroutines.delay(2000)
|
||||
kotlinx.coroutines.delay(2000.milliseconds)
|
||||
onZnsDataLoadedChange(true)
|
||||
showImportProgress = false
|
||||
}
|
||||
@@ -1295,12 +1296,12 @@ private fun Step2Sparten(
|
||||
val vBis = veranstaltung?.datumBis?.let { LocalDate.parse(it) }
|
||||
val tVon = try {
|
||||
LocalDate.parse(von)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
val tBis = if (bis.isBlank()) tVon else try {
|
||||
LocalDate.parse(bis)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user