From a050cb271cb9dbefc81283047a421b7f199cd09c Mon Sep 17 00:00:00 2001 From: Lorem Date: Sun, 19 Jul 2020 19:53:30 +0530 Subject: [PATCH] Fix wrong message time(12:XX pm showing as 00:XX pm) --- lib/utils/date_time_extension.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/date_time_extension.dart b/lib/utils/date_time_extension.dart index 60a1983..98c51c6 100644 --- a/lib/utils/date_time_extension.dart +++ b/lib/utils/date_time_extension.dart @@ -34,8 +34,8 @@ extension DateTimeExtension on DateTime { /// Returns a simple time String. /// TODO: Add localization String localizedTimeOfDay(BuildContext context) { - return L10n.of(context).timeOfDay( - _z(hour % 12), _z(hour), _z(minute), hour > 11 ? 'pm' : 'am'); + return L10n.of(context).timeOfDay(_z(hour == 12 ? hour : hour % 12), + _z(hour), _z(minute), hour > 11 ? 'pm' : 'am'); } /// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week