Flow: MessageList::setTimeFormatter
Add the following methods:
class MessageList {
void setTimeFormatter(SerializableFunction<Instant, String> timeFormatter)
SerializableFunction<Instant, String> getTimeFormatter()
}
The timeFormatter should be used for the time property in MessageListItem objects when converting to the client-side items array.
If the list already has items when calling the setter, the items array should be generated again.
We decided to implement the default formatting by using client-side code, so that we can provide the best possible default behavior by using the user's browser's time zone: vaadin/vaadin-messages#25.
It needs to be re-evaluated if we want to provide this API that converts the times to strings at server-side, since the default behavior can't be achieved with that.
I think the main issue is that there should be a way to customise the formatting of the timestamp. If not in the backend, then how to customise it in the client-side code? E.g. I would like to display the seconds as well.