Skip to content

Commit

Permalink
chore: Follow up use 24 hour format
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Jul 4, 2024
1 parent fc867b3 commit e88afdd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/l10n/intl_de.arb
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/date_time_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e88afdd

Please sign in to comment.