chore: Follow up time of day format

This commit is contained in:
Krille 2024-07-04 10:59:52 +02:00
parent 873362428c
commit fc867b33a1
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -35,7 +35,9 @@ extension DateTimeExtension on DateTime {
/// Returns a simple time String.
String localizedTimeOfDay(BuildContext context) =>
DateFormat.Hm(L10n.of(context)!.localeName).format(this);
MediaQuery.of(context).alwaysUse24HourFormat
? DateFormat('HH:mm', L10n.of(context)!.localeName).format(this)
: DateFormat('h:mm a', L10n.of(context)!.localeName).format(this);
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
/// day if the ChatTime is this week and a date string else.