Skip to content

Commit

Permalink
chore: use time format based on system settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Nov 3, 2024
1 parent 2f39b1e commit 76d2eef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/date_time_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ extension DateTimeExtension on DateTime {

/// Returns a simple time String.
String localizedTimeOfDay(BuildContext context) =>
L10n.of(context).alwaysUse24HourFormat == 'true'
MediaQuery.alwaysUse24HourFormatOf(context) ||
L10n.of(context).alwaysUse24HourFormat == 'true'
? DateFormat('HH:mm', L10n.of(context).localeName).format(this)
: DateFormat('h:mm a', L10n.of(context).localeName).format(this);

Expand Down

0 comments on commit 76d2eef

Please sign in to comment.