mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-18 20:08:53 +01:00
Allow selecting schedule time for message
This commit is contained in:
@@ -75,4 +75,16 @@ class DateFormatter @Inject constructor(val context: Context) {
|
||||
}.format(date)
|
||||
}
|
||||
|
||||
fun getScheduledTimestamp(date: Long): String {
|
||||
val now = Calendar.getInstance()
|
||||
val then = Calendar.getInstance()
|
||||
then.timeInMillis = date
|
||||
|
||||
return when {
|
||||
now.isSameDay(then) -> getFormatter("h:mm a")
|
||||
now.isSameYear(then) -> getFormatter("MMM d h:mm a")
|
||||
else -> getFormatter("MMM d yyyy h:mm a")
|
||||
}.format(date)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user