formatShort static method
Formats provided date
to a fuzzy time like 5m
- If
locale
is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults toen_short
- If
now
is passed this will be the point of reference for calculating the elapsed time. Defaults to DateTime.now() - If
max
is passed, format will only happen between that duration and beyond that simple date format will be shown. To avoid format limits, Passnull
. Defaults to14
days - If
withFuture
is passed, format will use the From prefix. ie.5m
Implementation
static String formatShort(
DateTime date, {
String? locale,
DateTime? now,
Duration? max = const Duration(days: 14),
bool withFuture = false,
}) =>
format(
date,
locale: locale,
now: now,
max: max,
short: true,
withFuture: withFuture,
);