You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a list of all the places where time and or date are rendered across the application.
We could want to review them, and decide for a format.
Constraints are:
the date and time must render correctly regarding the current Locale
the date and time may render differently depending on the diff with now
other?
Element X Android has a recent update on this part, and we have introduced date and time "Mode" (DateFormatterMode, code), combined with a boolean useRelative:
interfaceDateFormatter {
funformat(
timestamp:Long?,
mode:DateFormatterMode = DateFormatterMode.Full,
useRelative:Boolean = false,
): String
}
enumclassDateFormatterMode {
/** * Full date and time. * Example: * "April 6, 1980 at 6:35 PM" * Format can be shorter when useRelative is true. * Example: * "6:35 PM"*/Full,
/** * Only month and year. * Example: * "April 1980" * "This month" can be returned when useRelative is true. * Example: * "This month"*/Month,
/** * Only day. * Example: * "Sunday 6 April" * "Today", "Yesterday" and day of week can be returned when useRelative is true.*/Day,
/** * Time if same day, else date.*/TimeOrDate,
/** * Only time whatever the day.*/TimeOnly,
}
Usage
Comment
Mode
useRelative
Screenshot
Room list last message
-
TimeOrDate
true
Timeline day separator
-
Day
true
Timeline event
This is not ideal without sticky headers for the day, when scrolling through history, but sticky headers are coming "soon"
TimeOnly
false
Event details
-
Full
true
Gallery month separator
-
Month
true
Gallery item top title
-
Day
false
Gallery item detail
-
Full
false
Reaction details
-
TimeOrDate
false
Read receipt details
-
TimeOrDate
false
Poll in poll history
-
Day
true
Incoming verification request
-
TimeOrDate
false
The text was updated successfully, but these errors were encountered:
Here is a list of all the places where time and or date are rendered across the application.
We could want to review them, and decide for a format.
Constraints are:
now
Element X Android has a recent update on this part, and we have introduced date and time "Mode" (
DateFormatterMode
, code), combined with a booleanuseRelative
:The text was updated successfully, but these errors were encountered: