RelativeDateHeader.kt 526 B

12345678910111213141516171819202122
  1. package eu.kanade.presentation.components
  2. import androidx.compose.runtime.Composable
  3. import androidx.compose.runtime.remember
  4. import androidx.compose.ui.Modifier
  5. import tachiyomi.presentation.core.components.ListGroupHeader
  6. import java.text.DateFormat
  7. import java.util.Date
  8. @Composable
  9. fun RelativeDateHeader(
  10. modifier: Modifier = Modifier,
  11. date: Date,
  12. dateFormat: DateFormat,
  13. ) {
  14. ListGroupHeader(
  15. modifier = modifier,
  16. text = remember {
  17. dateFormat.format(date)
  18. },
  19. )
  20. }