RelativeTimeSpanStringResolver
A StringResolver that takes a time and resolves it to a String representation that shows the relative time.
When the instant of time represented by time is:
Within the last/next minute, shows:
now.Within the last/next hour shows:
__ min(s) agoorin __ min(s). For example:31 mins agofor an instant of time 31 mins ago.More than an hour in the past or in the future, but within 24 hours of the current time, shows:
__ hr(s) agoorin __ hr(s). For example:2 hrs agofor a time 2 hours 59 mins ago.Yesterday/tomorrow shows the time in
HH:mmorh:mformat with optionallyAM/PMbased on the locale. For example:23:13for a time tomorrow at 23 hours 13 mins.Within the last/next 7 days, shows the day of the week. For example:
Mondayfor a time 7 days in the future.More than 7 days in the past/future, shows the date without the year. For example:
21 March.More than a year in the past/future, shows the date with the year. For example:
21 March 2021.
Parameters
The instant of time to calculate the relative time from.
indicates how often the underlying string should be updated.