translate date on list by tag and by organizer
This commit is contained in:
@@ -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!}'),
|
||||
|
@@ -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!}'),
|
||||
|
Reference in New Issue
Block a user