From 7ab59eb843e2617b99de8ce139fbe6c375f0233c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:30:13 -0500 Subject: [PATCH] solving problem with the time in shifts --- .../lib/src/presentation/blocs/shifts/shifts_bloc.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart index 1aa10435..6a8c1c43 100644 --- a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart @@ -281,15 +281,20 @@ class ShiftsBloc extends Bloc List _filterPastShifts(List shifts) { final now = DateTime.now(); + final today = DateTime(now.year, now.month, now.day); return shifts.where((shift) { if (shift.date.isEmpty) return false; try { final shiftDate = DateTime.parse(shift.date); - return shiftDate.isAfter(now); + final dateOnly = DateTime( + shiftDate.year, + shiftDate.month, + shiftDate.day, + ); + return !dateOnly.isBefore(today); } catch (_) { return false; } }).toList(); } } -