mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-24 13:48:55 +03:00
Fix DST issue (#6831)
This commit is contained in:
parent
5409af0a6c
commit
dd490f2ac9
1 changed files with 4 additions and 3 deletions
|
@ -112,8 +112,8 @@ fun Date.toRelativeString(
|
||||||
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
|
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
|
||||||
return when {
|
return when {
|
||||||
difference < 0 -> context.getString(R.string.recently)
|
difference < 0 -> context.getString(R.string.recently)
|
||||||
difference <= MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
|
difference < MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
|
||||||
difference <= MILLISECONDS_IN_DAY.times(range) -> context.resources.getQuantityString(
|
difference < MILLISECONDS_IN_DAY.times(range) -> context.resources.getQuantityString(
|
||||||
R.plurals.relative_time,
|
R.plurals.relative_time,
|
||||||
days,
|
days,
|
||||||
days
|
days
|
||||||
|
@ -126,7 +126,8 @@ private val Date.timeWithOffset: Long
|
||||||
get() {
|
get() {
|
||||||
return Calendar.getInstance().run {
|
return Calendar.getInstance().run {
|
||||||
time = this@timeWithOffset
|
time = this@timeWithOffset
|
||||||
this@timeWithOffset.time + timeZone.rawOffset
|
val dstOffset = get(Calendar.DST_OFFSET)
|
||||||
|
this@timeWithOffset.time + timeZone.rawOffset + dstOffset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue