From 1c2e988c82738f8dce583bcaacdbc76add584978 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 17 Mar 2025 21:03:12 +0100 Subject: [PATCH] Show the start and end dates for the current routine in the dashboard The date in which the routine was created is not so important anymore --- lib/widgets/dashboard/widgets.dart | 5 +++-- lib/widgets/routines/routines_list.dart | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 7a8d0f984..ca2da1497 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -461,6 +461,8 @@ class _DashboardWorkoutWidgetState extends State { @override Widget build(BuildContext context) { + final dateFormat = DateFormat.yMd(Localizations.localeOf(context).languageCode); + return Card( child: Column( children: [ @@ -471,8 +473,7 @@ class _DashboardWorkoutWidgetState extends State { ), subtitle: Text( _hasContent - ? DateFormat.yMd(Localizations.localeOf(context).languageCode) - .format(_routine!.created) + ? '${dateFormat.format(_routine!.start)} - ${dateFormat.format(_routine!.end)}' : '', ), leading: Icon( diff --git a/lib/widgets/routines/routines_list.dart b/lib/widgets/routines/routines_list.dart index 14ca64554..4701047e2 100644 --- a/lib/widgets/routines/routines_list.dart +++ b/lib/widgets/routines/routines_list.dart @@ -38,6 +38,8 @@ class _RoutinesListState extends State { @override Widget build(BuildContext context) { + final dateFormat = DateFormat.yMd(Localizations.localeOf(context).languageCode); + return RefreshIndicator( onRefresh: () => widget._routineProvider.fetchAndSetAllPlansSparse(), child: widget._routineProvider.items.isEmpty @@ -71,8 +73,8 @@ class _RoutinesListState extends State { }, title: Text(currentRoutine.name), subtitle: Text( - '${DateFormat.yMd(Localizations.localeOf(context).languageCode).format(currentRoutine.start)}' - ' - ${DateFormat.yMd(Localizations.localeOf(context).languageCode).format(currentRoutine.end)}', + '${dateFormat.format(currentRoutine.start)}' + ' - ${dateFormat.format(currentRoutine.end)}', ), trailing: Row( mainAxisSize: MainAxisSize.min,