translate date on list by tag and by organizer

This commit is contained in:
2025-08-06 22:17:53 +02:00
parent cbc75bbc7b
commit 0a62011b3a
2 changed files with 11 additions and 2 deletions

View File

@@ -183,8 +183,13 @@ class _MyHomePageState extends State<ListItemOrganizers> {
final post = posts[index];
final startDate = DateTime.parse(post.startDate!);
final locale = Provider.of<LocaleProvider>(context, listen: false)
.locale
?.toString() ??
'en_US';
final dateLongue =
DateFormat('EEEE d MMMM y', 'fr_FR').format(startDate);
DateFormat('EEEE d MMMM y', locale).format(startDate);
return ListTile(
title: Text('${post.name!}'),

View File

@@ -184,8 +184,12 @@ class _MyHomePageState extends State<ListItemTags> {
itemBuilder: (context, index) {
final post = posts[index];
final startDate = DateTime.parse(post.startDate!);
final locale = Provider.of<LocaleProvider>(context, listen: false)
.locale
?.toString() ??
'en_US';
final dateLongue =
DateFormat('EEEE d MMMM y', 'fr_FR').format(startDate);
DateFormat('EEEE d MMMM y', locale).format(startDate);
return ListTile(
title: Text('${post.name!}'),