mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 20:19:05 +01:00
Set start date when tracker is bound if any chapters are already read
Closes #6734
This commit is contained in:
@@ -3,6 +3,9 @@ package eu.kanade.tachiyomi.util.lang
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.R
|
||||
import java.text.DateFormat
|
||||
import java.time.Instant
|
||||
import java.time.LocalDateTime
|
||||
import java.time.ZoneId
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.TimeZone
|
||||
@@ -17,6 +20,16 @@ fun Date.toTimestampString(): String {
|
||||
return DateFormat.getTimeInstance(DateFormat.SHORT).format(this)
|
||||
}
|
||||
|
||||
fun Long.convertEpochMillisZone(
|
||||
from: ZoneId,
|
||||
to: ZoneId,
|
||||
): Long {
|
||||
return LocalDateTime.ofInstant(Instant.ofEpochMilli(this), from)
|
||||
.atZone(to)
|
||||
.toInstant()
|
||||
.toEpochMilli()
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date as time key
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user