Kategorien, Pakete und Repositories suchen

GitHub-Repositorybaderouaich/time_ago_provider

time_ago_provider

Bibliothek zur Erzeugung von unscharfen Zeitstempeln, beispielsweise ("vor 9 Minuten")

Projektcover von time_ago_provider
Sterne
17
Forks
12
Letzter Push (UTC)
06.10.2023
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

time_ago_provider

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

pub package Github test

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

void main() {
  /// Default Format (summary of elapsed time)
  final nineMinutesElapsed = DateTime.now().subtract(Duration(minutes: 9));
  print(timeAgo.format(nineMinutesElapsed)); // 9 minutes ago
  print(timeAgo.format(nineMinutesElapsed, locale: 'en_short')); // 9 min

  /// Full Format (detailed elapsed time years, months, days...)
  final longTimeElapsed = DateTime.now().subtract(Duration(days: 999, hours: 6, minutes: 8, seconds: 3));
  print(timeAgo.formatFull(longTimeElapsed)); // 2 years, 9 months, 9 days, 6 hours, 8 minutes, 3 seconds
  print(timeAgo.formatFull(longTimeElapsed, locale: 'en_short')); // 2 yr, 9 mo, 9 d, 6 h, 8 min, 3 sec

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

Supported Languages

  • [x] ENGLISH
  • [x] GERMAN
  • [x] POLISH
  • [x] FRENCH
  • [x] ARABIC
  • [x] TURKISH
  • [x] PORTUGUESE
  • [x] ITALIAN
  • [x] SWEDISH
  • [x] NORWEGIAN
  • [x] PERSIAN
  • [x] SPANISH
  • 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.

Bader GitHub avatar
GitHub-Autor

Bader ↗

SprachenDart

Kategorien

Verwendete Abhängigkeiten

Abhängigkeiten 3 Einträge

  • flutter_coverage_badgeEntwicklung^0.0.1+1
  • flutter_lintsEntwicklung^2.0.1
  • testEntwicklung^1.16.5

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗