From 71cfed1cf6472ea5ee97aa8a22bd444a6df09e11 Mon Sep 17 00:00:00 2001 From: Santo Shakil Date: Wed, 12 Aug 2026 18:14:43 +0600 Subject: [PATCH] use DateFormat pinned to the built in locale for the group date --- mobile/lib/utils/datetime_helpers.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/lib/utils/datetime_helpers.dart b/mobile/lib/utils/datetime_helpers.dart index 6c0778f180..89b0325bfa 100644 --- a/mobile/lib/utils/datetime_helpers.dart +++ b/mobile/lib/utils/datetime_helpers.dart @@ -1,3 +1,5 @@ +import 'package:intl/intl.dart'; + const int _maxMillisecondsSinceEpoch = 8640000000000000; // 275760-09-13 const int _minMillisecondsSinceEpoch = -62135596800000; // 0001-01-01 @@ -18,6 +20,4 @@ DateTime? tryFromSecondsSinceEpoch(int? secondsSinceEpoch, {bool isUtc = false}) } } -// no DateFormat: it tracks Intl.defaultLocale and needs locale init per isolate -String timelineGroupDate(DateTime value) => - '${value.year.toString().padLeft(4, '0')}-${value.month.toString().padLeft(2, '0')}-${value.day.toString().padLeft(2, '0')}'; +String timelineGroupDate(DateTime value) => DateFormat('yyyy-MM-dd', 'en_US').format(value);