2022-07-18 08:17:40 +06:00
|
|
|
package eu.kanade.presentation.components
|
2022-06-18 20:55:58 +02:00
|
|
|
|
|
|
|
import androidx.compose.runtime.Composable
|
2022-06-28 05:33:57 +07:00
|
|
|
import androidx.compose.runtime.remember
|
2022-06-18 20:55:58 +02:00
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.platform.LocalContext
|
|
|
|
import eu.kanade.tachiyomi.util.lang.toRelativeString
|
|
|
|
import java.text.DateFormat
|
|
|
|
import java.util.Date
|
|
|
|
|
|
|
|
@Composable
|
2022-07-18 08:17:40 +06:00
|
|
|
fun RelativeDateHeader(
|
2022-06-18 20:55:58 +02:00
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
date: Date,
|
|
|
|
relativeTime: Int,
|
|
|
|
dateFormat: DateFormat,
|
|
|
|
) {
|
2022-06-28 05:33:57 +07:00
|
|
|
val context = LocalContext.current
|
2022-11-23 21:22:20 +07:00
|
|
|
ListGroupHeader(
|
|
|
|
modifier = modifier,
|
2022-06-28 05:33:57 +07:00
|
|
|
text = remember {
|
|
|
|
date.toRelativeString(
|
|
|
|
context,
|
|
|
|
relativeTime,
|
|
|
|
dateFormat,
|
|
|
|
)
|
|
|
|
},
|
2022-06-18 20:55:58 +02:00
|
|
|
)
|
|
|
|
}
|