Added in API level 1

DateSorter


open class DateSorter
kotlin.Any
   ↳ android.webkit.DateSorter

Sorts dates into the following groups: Today Yesterday seven days ago one month ago older than a month ago

Summary

Constants
static Int

must be >= 3

Public constructors
DateSorter(context: Context!)

Public methods
open Long
getBoundary(index: Int)

open Int
getIndex(time: Long)

open String!
getLabel(index: Int)

Constants

DAY_COUNT

Added in API level 1
static val DAY_COUNT: Int

must be >= 3

Value: 5

Public constructors

DateSorter

Added in API level 1
DateSorter(context: Context!)
Parameters
context Context!: Application context

Public methods

getBoundary

Added in API level 1
open fun getBoundary(index: Int): Long
Parameters
index Int: date bin index as returned by getIndex()
Return
Long date boundary at given index

getIndex

Added in API level 1
open fun getIndex(time: Long): Int
Parameters
time Long: time since the Epoch in milliseconds, such as that returned by Calendar.getTimeInMillis()
Return
Int an index from 0 to (DAY_COUNT - 1) that identifies which date bin this date belongs to

getLabel

Added in API level 1
open fun getLabel(index: Int): String!
Parameters
index Int: date bin index as returned by getIndex()
Return
String! string label suitable for display to user