Add date to unlinked dialog.

This commit is contained in:
Michelle Tang
2025-01-16 15:45:16 -05:00
committed by Greyson Parrelli
parent 5a4c8a6f9a
commit 71c21eeba6
3 changed files with 16 additions and 3 deletions

View File

@@ -181,6 +181,17 @@ object DateUtils : android.text.format.DateUtils() {
return timestamp.toDateString(format.toString(), locale)
}
/**
* Formats the timestamp as a date, without the year, followed by the time
* eg. Jan 15 at 9:00pm
*/
@JvmStatic
fun getDateTimeString(context: Context, locale: Locale, timestamp: Long): String {
val date = timestamp.toDateString("MMM d", locale)
val time = timestamp.toLocalTime().formatHours(context)
return context.getString(R.string.DateUtils_date_at, date, time)
}
/**
* Formats the passed timestamp based on the current time at a day precision.
*