forked from firka/firka
tt: fix date display
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -202,7 +202,7 @@ class _HomeTimetableScreen extends State<HomeTimetableScreen> {
|
||||
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<HomeTimetableScreen> {
|
||||
.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),
|
||||
|
||||
Reference in New Issue
Block a user