Skip to content

Commit 3309631

Browse files
committed
feat: add concise English timeago messages
- Implemented concise timeago messages - Added no prefixes, suffixes instead - Used abbreviations for units
1 parent 4c9a234 commit 3309631

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import 'package:timeago/timeago.dart' as timeago;
2+
3+
/// Custom English lookup messages for the timeago package (concise).
4+
class EnTimeagoMessages implements timeago.LookupMessages {
5+
@override
6+
String prefixAgo() => ''; // No prefix
7+
@override
8+
String prefixFromNow() => ''; // No prefix
9+
@override
10+
String suffixAgo() => ' ago'; // Suffix instead
11+
@override
12+
String suffixFromNow() => ' from now'; // Suffix instead
13+
14+
@override
15+
String lessThanOneMinute(int seconds) => 'now';
16+
@override
17+
String aboutAMinute(int minutes) => '1m';
18+
@override
19+
String minutes(int minutes) => '${minutes}m';
20+
21+
@override
22+
String aboutAnHour(int minutes) => '1h';
23+
@override
24+
String hours(int hours) => '${hours}h';
25+
26+
@override
27+
String aDay(int hours) => '1d';
28+
@override
29+
String days(int days) => '${days}d';
30+
31+
@override
32+
String aboutAMonth(int days) => '1mo';
33+
@override
34+
String months(int months) => '${months}mo';
35+
36+
@override
37+
String aboutAYear(int year) => '1y';
38+
@override
39+
String years(int years) => '${years}y';
40+
41+
@override
42+
String wordSeparator() => ' ';
43+
}

0 commit comments

Comments
 (0)