diff --git a/assets/l10n/intl_de.arb b/assets/l10n/intl_de.arb index adf2d99d..07dea5ae 100644 --- a/assets/l10n/intl_de.arb +++ b/assets/l10n/intl_de.arb @@ -1,6 +1,10 @@ { "@@locale": "de", "@@last_modified": "2021-08-14 12:41:10.119255", + "alwaysUse24HourFormat": "true", + "@alwaysUse24HourFormat": { + "description": "Set to true to always display time of day in 24 hour format." + }, "about": "Über", "@about": { "type": "text", diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index b687dc86..cfd26a7c 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -1,6 +1,10 @@ { "@@locale": "en", "@@last_modified": "2021-08-14 12:38:37.885451", + "alwaysUse24HourFormat": "false", + "@alwaysUse24HourFormat": { + "description": "Set to true to always display time of day in 24 hour format." + }, "repeatPassword": "Repeat password", "@repeatPassword": {}, "notAnImage": "Not an image file.", diff --git a/lib/utils/date_time_extension.dart b/lib/utils/date_time_extension.dart index d02f4533..13bae4ef 100644 --- a/lib/utils/date_time_extension.dart +++ b/lib/utils/date_time_extension.dart @@ -35,7 +35,7 @@ extension DateTimeExtension on DateTime { /// Returns a simple time String. String localizedTimeOfDay(BuildContext context) => - MediaQuery.of(context).alwaysUse24HourFormat + L10n.of(context)!.alwaysUse24HourFormat == 'true' ? DateFormat('HH:mm', L10n.of(context)!.localeName).format(this) : DateFormat('h:mm a', L10n.of(context)!.localeName).format(this);