diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 80cb4bad0..d5037187e 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -112,8 +112,6 @@ class DashboardPageBody extends StatefulWidget { } class DashboardPageBodyState extends State { - static final transactionDateFormat = DateFormat("MMMM d, yyyy HH:mm"); - final _connectionStatusObserverKey = GlobalKey(); final _balanceObserverKey = GlobalKey(); final _balanceTitleObserverKey = GlobalKey(); @@ -127,6 +125,7 @@ class DashboardPageBodyState extends State { final actionListStore = Provider.of(context); final syncStore = Provider.of(context); final settingsStore = Provider.of(context); + final transactionDateFormat = DateFormat("MMMM d, yyyy HH:mm", settingsStore.languageCode); return Observer( key: _listObserverKey, diff --git a/lib/src/screens/dashboard/date_section_raw.dart b/lib/src/screens/dashboard/date_section_raw.dart index 155bbc22b..fb41f674f 100644 --- a/lib/src/screens/dashboard/date_section_raw.dart +++ b/lib/src/screens/dashboard/date_section_raw.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:provider/provider.dart'; +import 'package:cake_wallet/src/stores/settings/settings_store.dart'; class DateSectionRaw extends StatelessWidget { DateSectionRaw({this.date}); - static final dateSectionDateFormat = DateFormat("d MMM"); static final nowDate = DateTime.now(); - final DateTime date; @override @@ -17,6 +17,9 @@ class DateSectionRaw extends StatelessWidget { final isToday = nowDate.day == date.day && nowDate.month == date.month && nowDate.year == date.year; + final settingsStore = Provider.of(context); + final currentLanguage = settingsStore.languageCode; + final dateSectionDateFormat = DateFormat("d MMM", currentLanguage); var title = ""; if (isToday) { @@ -24,7 +27,7 @@ class DateSectionRaw extends StatelessWidget { } else if (diffDays == 0) { title = S.of(context).yesterday; } else if (diffDays > -7 && diffDays < 0) { - final dateFormat = DateFormat("EEEE"); + final dateFormat = DateFormat.EEEE(currentLanguage); title = dateFormat.format(date); } else { title = dateSectionDateFormat.format(date);