time_ago_provider 2.1.0 copy "time_ago_provider: ^2.1.0" to clipboard
time_ago_provider: ^2.1.0 copied to clipboard

outdated

library for generating fuzzy timestamp for example ("9 minutes ago")

time_ago_provider #

library for generating fuzzy timestamp e.g("9 minutes ago")

import 'package:time_ago_provider/time_ago_provider.dart' as timeAgo;

void main() {
  /// Get the timestamp
  final nineMinutesElapsed = DateTime.now().subtract(Duration(minutes: 9));

  /// Format & get elapsed String
  print(timeAgo.format(nineMinutesElapsed)); // 9 minutes ago
  print(timeAgo.format(nineMinutesElapsed, locale: 'en_short')); // 9 min

  /// Adding new locales
  timeAgo.setLocale('de', timeAgo.German());
  timeAgo.setLocale('de_short', timeAgo.German(shortForm: true));
  print(timeAgo.format(nineMinutesElapsed, locale: 'de')); // vor 9 Minuten
  print(timeAgo.format(nineMinutesElapsed, locale: 'de_short')); // 9 Min.
}

Supported Languages #

  • ENGLISH
  • GERMAN
  • POLISH
  • FRENCH
  • ARABIC
  • TURKISH
  • More will be added

Installing #

Package

Contributors ✨ #

Thanks goes to these wonderful people!

Features and bugs #

If you face any problems feel free to open an issue at the issue tracker. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome.

31
likes
0
pub points
87%
popularity

Publisher

unverified uploader

library for generating fuzzy timestamp for example ("9 minutes ago")

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on time_ago_provider