feat: remember comment sort order

This commit is contained in:
rebelonion 2024-02-15 14:17:45 -06:00
parent 4c35f9a0cf
commit ee7cff0fea
3 changed files with 126 additions and 40 deletions

View file

@ -164,10 +164,12 @@ class CommentItem(val comment: Comment,
}
}
fun timestampToMillis(timestamp: String): Long {
val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
dateFormat.timeZone = TimeZone.getTimeZone("UTC")
val parsedDate = dateFormat.parse(timestamp)
return parsedDate?.time ?: 0
companion object {
fun timestampToMillis(timestamp: String): Long {
val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
dateFormat.timeZone = TimeZone.getTimeZone("UTC")
val parsedDate = dateFormat.parse(timestamp)
return parsedDate?.time ?: 0
}
}
}