mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Use LocalDate.ofInstant()
This commit is contained in:
parent
c7c3d87ee5
commit
3dc29b1983
@ -64,9 +64,7 @@ object TextUtils {
|
||||
}
|
||||
|
||||
fun formatRelativeDate(context: Context, unixTime: Long): CharSequence {
|
||||
// TODO: Use LocalDate.ofInstant() when it is available in SDK 34.
|
||||
val date = LocalDateTime.ofInstant(Instant.ofEpochMilli(unixTime), ZoneId.systemDefault())
|
||||
.toLocalDate()
|
||||
val date = LocalDate.ofInstant(Instant.ofEpochMilli(unixTime), ZoneId.systemDefault())
|
||||
val now = LocalDate.now()
|
||||
val months = date.until(now, ChronoUnit.MONTHS)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user