use DateFormat pinned to the built in locale for the group date

This commit is contained in:
Santo Shakil 2026-08-12 18:14:43 +06:00
parent 88020b362a
commit 71cfed1cf6

View file

@ -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);