2021-02-12 17:53:51 +01:00
|
|
|
import 'package:timeago/timeago.dart' as timeago;
|
|
|
|
|
|
|
|
extension FancyTime on DateTime {
|
2021-02-12 23:44:15 +01:00
|
|
|
/// returns `this` time as a relative, human-readable string. In short format
|
2021-02-13 17:03:40 +01:00
|
|
|
String get fancyShort => timeago.format(this, locale: 'en_short');
|
2021-02-12 17:53:51 +01:00
|
|
|
|
2021-02-12 23:44:15 +01:00
|
|
|
/// returns `this` time as a relative, human-readable string
|
2021-02-13 17:03:40 +01:00
|
|
|
String get fancy => timeago.format(this);
|
2021-02-12 17:53:51 +01:00
|
|
|
}
|