fix: Don't show date twice

This commit is contained in:
Ahmad Ansori Palembani 2024-06-12 11:14:13 +07:00
parent 9857ff943e
commit 3b42210f10
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import androidx.work.WorkInfo
import androidx.work.WorkManager
import androidx.work.WorkQuery
import eu.kanade.tachiyomi.ui.base.presenter.BaseCoroutinePresenter
import eu.kanade.tachiyomi.util.lang.toDateTimeTimestampString
import eu.kanade.tachiyomi.util.lang.toDateTimestampString
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
@ -68,8 +68,8 @@ class WorkerInfoPresenter : BaseCoroutinePresenter<WorkerInfoController>() {
Instant.ofEpochMilli(workInfo.nextScheduleTimeMillis),
ZoneId.systemDefault(),
)
.toDateTimeTimestampString(DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT))
appendLine("Next scheduled run: $timestamp",)
.toDateTimestampString(DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT))
appendLine("Next scheduled run: $timestamp")
appendLine("Attempt #${workInfo.runAttemptCount + 1}")
}
appendLine()

View file

@ -6,9 +6,9 @@ import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
import java.util.*
fun LocalDateTime.toDateTimeTimestampString(dateTimeFormatter: DateTimeFormatter): String {
fun LocalDateTime.toDateTimestampString(dateTimeFormatter: DateTimeFormatter): String {
val date = dateTimeFormatter.format(this)
val time = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT).format(this)
val time = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT).format(this)
return "$date $time"
}