From ebb0453d56ba1f3ae6d926faa7804893269d9dd8 Mon Sep 17 00:00:00 2001 From: Lorem Date: Mon, 20 Jul 2020 22:38:39 +0530 Subject: [PATCH] (Actually)Fix wrong message time Forgot to account for 0:XX am in previous commit --- lib/utils/date_time_extension.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/date_time_extension.dart b/lib/utils/date_time_extension.dart index 98c51c6..5d94346 100644 --- a/lib/utils/date_time_extension.dart +++ b/lib/utils/date_time_extension.dart @@ -34,7 +34,7 @@ extension DateTimeExtension on DateTime { /// Returns a simple time String. /// TODO: Add localization String localizedTimeOfDay(BuildContext context) { - return L10n.of(context).timeOfDay(_z(hour == 12 ? hour : hour % 12), + return L10n.of(context).timeOfDay(_z(hour % 12 == 0 ? 12 : hour % 12), _z(hour), _z(minute), hour > 11 ? 'pm' : 'am'); }