diff --git a/firka/lib/helpers/extensions.dart b/firka/lib/helpers/extensions.dart index 435cd027..79bfe3d5 100644 --- a/firka/lib/helpers/extensions.dart +++ b/firka/lib/helpers/extensions.dart @@ -39,12 +39,11 @@ enum Cycle { morning, day, afternoon, night } extension DateExtension on DateTime { String format(AppLocalizations l10n, FormatMode mode) { - var today = timeNow(); - today = today.subtract(Duration( - hours: today.hour, - minutes: today.minute, - seconds: today.second, - milliseconds: today.millisecond)); + var today = subtract(Duration( + hours: hour, + minutes: minute, + seconds: second, + milliseconds: millisecond)); var tomorrowLim = today.add(Duration(days: 2)); var tomorrow = today.add(Duration(days: 1)); diff --git a/firka/lib/ui/phone/pages/home/home_timetable.dart b/firka/lib/ui/phone/pages/home/home_timetable.dart index 8370b860..c8627a17 100644 --- a/firka/lib/ui/phone/pages/home/home_timetable.dart +++ b/firka/lib/ui/phone/pages/home/home_timetable.dart @@ -202,7 +202,7 @@ class _HomeTimetableScreen extends State { Row( children: [ Text( - dates!.first.format( + now!.format( widget.data.l10n, FormatMode.yyyymmddwedd), style: appStyle.fonts.B_14R), SizedBox(width: 4), @@ -211,7 +211,7 @@ class _HomeTimetableScreen extends State { .apply(color: appStyle.colors.accent)), SizedBox(width: 4), Text( - dates!.first.isAWeek() + now!.isAWeek() ? widget.data.l10n.a_week : widget.data.l10n.b_week, style: appStyle.fonts.B_14R),