Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ fun relativeTimeStamp(epochSeconds: Long): String {
}

val days = hours / HOURS_IN_DAY
return "${days.toInt()}d ago"
if (days < DAYS_IN_WEEK) {
return "${days.toInt()}d ago"
}

val weeks = days / DAYS_IN_WEEK
return "${weeks.toInt()}w ago"
}

private const val SECONDS_IN_MINUTE = 60.0
private const val MINUTES_IN_HOUR = 60.0
private const val HOURS_IN_DAY = 24.0
private const val DAYS_IN_WEEK = 7.0