@@ -65,9 +65,11 @@ import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Facebook
6565import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.GitHub
6666import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Matrix
6767import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Telegram
68- import java.time.LocalDateTime
69- import java.time.ZonedDateTime
70- import java.time.format.DateTimeFormatter
68+ import kotlinx.datetime.LocalDateTime
69+ import kotlinx.datetime.TimeZone
70+ import kotlinx.datetime.format
71+ import kotlinx.datetime.toLocalDateTime
72+ import kotlin.time.Clock
7173
7274sealed class ReportMode {
7375 data object Matrix : ReportMode ()
@@ -252,7 +254,10 @@ fun sendReport(
252254 |${getPhoneInfo(context)}
253255 |
254256 |"Internal app problem"
255- |${LocalDateTime .now().format(DateTimeFormatter .ISO_DATE_TIME )}
257+ |${
258+ Clock .System .now().toLocalDateTime(TimeZone .currentSystemDefault())
259+ .format(LocalDateTime .Formats .ISO )
260+ }
256261 |$errorText
257262 |
258263 |${extraMessage ? : " " }
@@ -281,7 +286,10 @@ fun sendReport(
281286 ErrorSeverity .HANDLED -> " Internal app problem"
282287 }
283288 }
284- |${crash.date.format(DateTimeFormatter .ISO_DATE_TIME )}
289+ |${
290+ crash.date.toLocalDateTime(TimeZone .currentSystemDefault())
291+ .format(LocalDateTime .Formats .ISO )
292+ }
285293 |${crash.message}
286294 |${crash.trace}
287295 """ .trimMargin()
@@ -296,12 +304,30 @@ private fun doSend(
296304 copyToClipboard(context, text)
297305
298306 when (mode) {
299- Matrix -> sendMatrix(context, text)
300- Telegram -> sendTelegram(context, text)
301- GitHub -> sendGitHub(context, text)
302- Discord -> sendDiscord(context, text)
303- Facebook -> sendFacebook(context, text)
304- Email -> sendEmail(context, text)
307+ Matrix -> {
308+ sendMatrix(context, text)
309+ }
310+
311+ Telegram -> {
312+ sendTelegram(context, text)
313+ }
314+
315+ GitHub -> {
316+ sendGitHub(context, text)
317+ }
318+
319+ Discord -> {
320+ sendDiscord(context, text)
321+ }
322+
323+ Facebook -> {
324+ sendFacebook(context, text)
325+ }
326+
327+ Email -> {
328+ sendEmail(context, text)
329+ }
330+
305331 Clipboard -> {}
306332 }
307333}
@@ -314,7 +340,7 @@ private fun getPhoneInfo(context: Context): String {
314340 |App version code: ${BuildConfig .VERSION_CODE }
315341 |Phone model: ${Build .MODEL }
316342 |Phone manufacturer: ${Build .MANUFACTURER }
317- |Date and Time: ${ZonedDateTime . now().format( DateTimeFormatter . ISO_DATE_TIME )}
343+ |Date and Time: ${Clock . System . now()}
318344 |Screen size: ${metrics.widthPixels} x ${metrics.heightPixels} px
319345 """ .trimMargin()
320346}
0 commit comments