time_ago_provider
例として「9分前」といった曖昧なタイムスタンプを生成するためのライブラリ
- スター
- 17
- フォーク
- 12
- 最終プッシュ(UTC)
- 2023/10/06
- プロジェクト状態
- 公開中
元の README
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
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() {
/// 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
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.
言語Dart
カテゴリー
使用している依存関係
依存関係一覧 3 件
- flutter_coverage_badge開発用
^0.0.1+1 - flutter_lints開発用
^2.0.1 - test開発用
^1.16.5
プロジェクトに合うリポジトリを選ぶには?
用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
- 名前・作者・説明で検索し、技術トピックで絞り込みます。
- スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
- 利用前に GitHub で README、ライセンス、Issues を確認します。
情報源と管理
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗