RelativeTimeFormatUtils extension
Descriptive relative-time formatting on DateTime.
Companion to RelativeTimeUtils; kept in a separate extension only so each source file stays within the project's file-length limit. The callable surface (relativeTime on any DateTime) is unchanged from when this lived alongside the calendar-day predicates.
- on
Methods
-
relativeTime(
{DateTime? now, bool isDescriptive = true, bool isDescriptiveTimeSuffix = true, bool roundUp = false}) → String? -
Available on DateTime, provided by the RelativeTimeFormatUtils extension
Returns an English relative-time phrase between this DateTime andnow(defaults to DateTime.now).