Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 3ac2c5d

Browse files
committed
feat(calendar): remove option to show previous days in schedule view, now always shows them
1 parent f1226e5 commit 3ac2c5d

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

lib/database/tables/dashboard.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ enum DashboardDatabase<T> with LunaTableMixin<T> {
1313
CALENDAR_ENABLE_RADARR<bool>(true),
1414
CALENDAR_ENABLE_SONARR<bool>(true),
1515
CALENDAR_DAYS_PAST<int>(14),
16-
CALENDAR_DAYS_FUTURE<int>(14),
17-
CALENDAR_SHOW_PAST_DAYS<bool>(false);
16+
CALENDAR_DAYS_FUTURE<int>(14);
1817

1918
@override
2019
LunaTable get table => LunaTable.dashboard;

lib/modules/dashboard/routes/dashboard/widgets/schedule_view.dart

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:lunasea/database/tables/dashboard.dart';
32
import 'package:lunasea/extensions/scroll_controller.dart';
43
import 'package:lunasea/vendor.dart';
54

@@ -63,18 +62,12 @@ class _State extends State<ScheduleView> {
6362

6463
for (final key in keys) {
6564
final selected = context.read<ModuleState>().selected;
66-
final today = context.read<ModuleState>().today;
67-
68-
bool pastDays = DashboardDatabase.CALENDAR_SHOW_PAST_DAYS.read();
69-
bool dayInFuture = key.isAfter(today.subtract(const Duration(days: 1)));
70-
bool hasEvents = widget.events[key]?.isNotEmpty ?? false;
71-
bool isSelected = selected.isAtSameMomentAs(key);
72-
73-
if (isSelected) {
65+
if (selected.isAtSameMomentAs(key)) {
7466
offsetOfSelected = offset;
7567
}
7668

77-
if ((pastDays || dayInFuture) && hasEvents) {
69+
final hasEvents = widget.events[key]?.isNotEmpty ?? false;
70+
if (hasEvents) {
7871
final built = _buildDay(key);
7972
offset += built.item2;
8073
days.addAll(built.item1);

lib/modules/settings/routes/configuration_dashboard/pages/calendar_settings.dart

-14
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class _State extends State<ConfigurationDashboardCalendarRoute>
4545
children: [
4646
_futureDays(),
4747
_pastDays(),
48-
_pastDaysInSchedule(),
4948
LunaDivider(),
5049
_startingDay(),
5150
_startingSize(),
@@ -58,19 +57,6 @@ class _State extends State<ConfigurationDashboardCalendarRoute>
5857
);
5958
}
6059

61-
Widget _pastDaysInSchedule() {
62-
const _db = DashboardDatabase.CALENDAR_SHOW_PAST_DAYS;
63-
return _db.listenableBuilder(
64-
builder: (context, _) => LunaBlock(
65-
title: 'settings.PastDaysInScheduleView'.tr(),
66-
trailing: LunaSwitch(
67-
value: _db.read(),
68-
onChanged: _db.update,
69-
),
70-
),
71-
);
72-
}
73-
7460
Widget _pastDays() {
7561
const _db = DashboardDatabase.CALENDAR_DAYS_PAST;
7662
return _db.listenableBuilder(

0 commit comments

Comments
 (0)