Format date according to locale

This commit is contained in:
Roland Geider
2021-01-02 11:32:49 +01:00
parent 5d6a5887bd
commit 91c51dcb28
4 changed files with 5 additions and 11 deletions

View File

@@ -69,9 +69,7 @@ class NutritionalPlansList extends StatelessWidget {
arguments: currentPlan,
);
},
title: Text(
DateFormat('dd.MM.yyyy').format(currentPlan.creationDate).toString(),
),
title: Text(DateFormat.yMd().format(currentPlan.creationDate)),
subtitle: Text(currentPlan.description),
),
),

View File

@@ -50,7 +50,7 @@ class WeightEntriesList extends StatelessWidget {
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text(
"Deleted weight entry for the ${DateFormat('dd.MM.yyyy').format(currentEntry.date).toString()}",
"Deleted weight entry for the ${DateFormat.yMd().format(currentEntry.date).toString()}",
textAlign: TextAlign.center,
),
),
@@ -77,9 +77,7 @@ class WeightEntriesList extends StatelessWidget {
// arguments: currentPlan,
//),
onTap: () {},
title: Text(
DateFormat('dd.MM.yyyy').format(currentEntry.date).toString(),
),
title: Text(DateFormat.yMd().format(currentEntry.date).toString()),
subtitle: Text('${currentEntry.weight} kg'),
),
),

View File

@@ -75,7 +75,7 @@ class _WorkoutPlanDetailState extends State<WorkoutPlanDetail> {
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
DateFormat('dd.MM.yyyy').format(widget._workoutPlan.creationDate).toString(),
DateFormat.yMd().format(widget._workoutPlan.creationDate).toString(),
style: Theme.of(context).textTheme.headline6,
),
),

View File

@@ -97,9 +97,7 @@ class WorkoutPlansList extends StatelessWidget {
WorkoutPlanScreen.routeName,
arguments: currentWorkout,
),
title: Text(
DateFormat('dd.MM.yyyy').format(currentWorkout.creationDate).toString(),
),
title: Text(DateFormat.yMd().format(currentWorkout.creationDate)),
subtitle: Text(currentWorkout.description),
),
),