chore: Follow up time of day format

pull/1029/merge
Krille 1 year ago
parent 873362428c
commit fc867b33a1
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -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.

Loading…
Cancel
Save