chore(ui): bump jiffy to v6.2.1

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-07-04 14:43:42 +05:30
committed by xsahil03x
parent 3e5c1b2fa7
commit 79faac57e5
13 changed files with 46 additions and 31 deletions
@@ -287,16 +287,16 @@ class ChannelLastMessageDate extends StatelessWidget {
if (lastMessageAt.millisecondsSinceEpoch >=
startOfDay.millisecondsSinceEpoch) {
stringDate = Jiffy(lastMessageAt.toLocal()).jm;
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).jm;
} else if (lastMessageAt.millisecondsSinceEpoch >=
startOfDay
.subtract(const Duration(days: 1))
.millisecondsSinceEpoch) {
stringDate = context.translations.yesterdayLabel;
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
stringDate = Jiffy(lastMessageAt.toLocal()).EEEE;
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).EEEE;
} else {
stringDate = Jiffy(lastMessageAt.toLocal()).yMd;
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).yMd;
}
return Text(
@@ -227,9 +227,9 @@ class MessageSearchTileMessageDate extends StatelessWidget {
if (now.year != createdAt.year ||
now.month != createdAt.month ||
now.day != createdAt.day) {
stringDate = Jiffy(createdAt.toLocal()).yMd;
stringDate = Jiffy.parseFromDateTime(createdAt.toLocal()).yMd;
} else {
stringDate = Jiffy(createdAt.toLocal()).jm;
stringDate = Jiffy.parseFromDateTime(createdAt.toLocal()).jm;
}
return Text(
@@ -176,11 +176,12 @@ class UserLastActive extends StatelessWidget {
@override
Widget build(BuildContext context) {
final chatTheme = StreamChatTheme.of(context);
final lastActive = user.lastActive ?? DateTime.now();
return Text(
user.online
? context.translations.userOnlineText
: '${context.translations.userLastOnlineText} '
'${Jiffy(user.lastActive).fromNow()}',
'${Jiffy.parseFromDateTime(lastActive).fromNow()}',
style: chatTheme.textTheme.footnote.copyWith(
color: chatTheme.colorTheme.textHighEmphasis.withOpacity(0.5),
),