Fix critical bug where calendar days were misaligned with weekdays:
PROBLEM:
- January 1, 2026 showed as Monday instead of Thursday
- Calendar grid didn't calculate proper offset for first day of month
- Days were placed in grid without accounting for weekday padding
ROOT CAUSE:
- DatePicker component used eachDayOfInterval() to generate days
- Grid cells were populated directly from day 1 without offset calculation
- getDay() returns 0-6 (Sunday-Saturday) but calendar header uses Monday-Sunday
SOLUTION:
- Calculate offset using getDay() of first day of month
- Adjust for Monday-start week: offset = dayOfWeek === 0 ? 6 : dayOfWeek - 1
- Add padding cells (empty divs) at start of grid for correct alignment
- For January 2026: Thursday (getDay=4) → offset=3 (3 empty cells before day 1)
EXAMPLE:
- January 1, 2026 is Thursday (getDay=4)
- With Monday-start calendar: L M X J V S D
- Correct grid: _ _ _ 1 2 3 4 ... (3 empty cells then day 1)
This ensures all dates align correctly with their weekday headers.
Major changes:
- Add customer registration with email/phone lookup (app/booking/registro)
- Add customers API endpoint (app/api/customers/route)
- Implement business hours for locations (mon-fri 10-7, sat 10-6, sun closed)
- Fix availability function type casting issues
- Add business hours utilities (lib/utils/business-hours.ts)
- Update Location type to include business_hours JSONB
- Add mock payment component for testing
- Remove Supabase auth from booking flow
- Fix /cita redirect path in booking flow
Database migrations:
- Add category column to services table
- Add business_hours JSONB column to locations table
- Fix availability functions with proper type casting
- Update get_detailed_availability to use business_hours
Features:
- Customer lookup by email or phone
- Auto-redirect to registration if customer not found
- Pre-fill customer data if exists
- Business hours per day of week
- Location-specific opening/closing times