From 46acad0b550cf57302e313331439e0878bf14a3e Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sun, 12 Jul 2026 19:14:42 -0500 Subject: [PATCH] fix blocked/occupied slot detection always returning false Service.fromJson stored day as the raw Prisma JSON string "2024-01-15T00:00:00.000Z", but _isSelfBooked/_isOccupied/_isBlocked compared it against "2024-01-15" (toIso8601String().split('T').first), so the match always failed and every slot appeared as Disponible. Normalize day to the date-only portion in fromJson so all comparisons work correctly across ProfessionalCalendarView and CalendarView. Co-Authored-By: Claude Sonnet 4.6 --- lib/models/service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/service.dart b/lib/models/service.dart index fb96bb3..098f605 100644 --- a/lib/models/service.dart +++ b/lib/models/service.dart @@ -67,7 +67,7 @@ class Service { aditionalAddress: (doc['additional_address'] ?? doc['aditional_address']) as String? ?? '', latitude: (doc['latitude'] as num?)?.toDouble() ?? 0.0, longitude: (doc['longitude'] as num?)?.toDouble() ?? 0.0, - day: doc['day']?.toString() ?? '', + day: (doc['day']?.toString() ?? '').split('T').first, createdAt: doc['created_at']?.toString() ?? '', description: doc['description'] as String? ?? '', range1Hour1: _parseTime(doc['range1_hour1']?.toString() ?? '0:0'),