Overview
The Calendar View provides a visual, time-based interface for managing procurement requisitions. Built on FullCalendar, it displays delivery schedules as color-coded events, making it easy to identify upcoming deliveries, track status, and manage logistics at a glance.The calendar is the default landing page after login, accessible at
/dashboard/calendar. It serves as the primary navigation hub for procurement operations.FullCalendar Integration
The application uses FullCalendar 6.x with these plugins:Calendar Configuration
The calendar is displayed in Spanish (
locale="es") with localized button labels and date formatting.Event Data Structure
Requisitions are transformed into calendar events using theCalendarEvent interface:
Event Date Logic
Events are scheduled based on confirmed or requested delivery dates:Color Coding by Status
Events are automatically color-coded based on their status:Pendiente
Orange
#F59E0B - Awaiting confirmationConfirmado
Blue
#3B82F6 - Confirmed by supplierEn Tránsito
Purple
#8B5CF6 - Shipped and in transitRecibido
Green
#10B981 - Delivered and receivedCancelado
Red
#EF4444 - Order cancelledEn Revisión
Orange
#F97316 - Under reviewestatus catalog table and can be customized by admins.
Custom Event Rendering
Events use custom rendering to display rich information compactly:- Status icon (clock, truck, check, etc.) matching the status type
- Product name in bold with status color
- Supplier name in smaller, muted text
- Colored left border indicating status
- Transparent background using status color at 10% opacity
- Hover tooltip showing full details
Status Icons Mapping
View Modes
The calendar supports two primary view modes:Month View
dayGridMonth - Default view showing entire month
- Displays up to 3 events per day (configured via
dayMaxEvents) - Click ”+ more” to see additional events for busy days
- Best for high-level planning and overview
Week View
timeGridWeek - Detailed weekly schedule
- Shows events in time slots throughout the day
- Better for viewing detailed daily schedules
- Useful for same-day deliveries from multiple suppliers
Event Interaction
Clicking an event opens theEventDetailModal with complete requisition information:
- All requisition details (dates, quantities, comments)
- Supplier and product information
- Current status with color badge
- Edit button (if user has permission)
- Delete button (admin only)
- Full audit history
Filtering Calendar Events
TheSidebarFilters component allows users to filter visible events:
- Proveedor - Filter by supplier
- Fecha Desde - Show events from this date forward
- Additional filters can be added via the filters object
Loading States
The calendar displays skeleton loaders while fetching data:- Placeholder toolbar while loading
- Grid of 35 skeleton cells (5 weeks × 7 days)
- Smooth transition to actual calendar
Navigation Controls
Performance Optimization
The calendar component is optimized for performance:- Client-only rendering to avoid SSR hydration issues
- Memoized event transformation
- Lazy loading of FullCalendar plugins
- Efficient re-rendering only when data changes
Responsive Design
The calendar adapts to different screen sizes:- Desktop: Full month/week view with all event details
- Tablet: Slightly condensed event cards
- Mobile: Events show abbreviated information, tap to expand
The calendar uses
dayMaxEvents={3} to prevent overcrowding. On busy days, excess events are hidden behind a ”+ more” link that opens a popover.Integration with Other Features
Create Requisition
Click the “Nueva Requisición” button in the header to add a new event directly from calendar view
View Table
Switch to
/dashboard/requisiciones for a tabular view of the same data with sorting and advanced filteringUpcoming Deliveries
The sidebar shows a list of deliveries scheduled for the next 7 days with quick access
Status Legend
A color-coded legend in the sidebar helps users quickly identify event status at a glance
Best Practices
Choosing the right view
Choosing the right view
- Use Month View for long-term planning and identifying busy periods
- Use Week View when coordinating multiple same-day deliveries
- Switch views frequently to maintain both strategic and tactical awareness
Managing busy days
Managing busy days
When a single day has many deliveries:
- Click the ”+ more” link to see all events for that day
- Consider staggering delivery times if possible
- Use the week view to see hourly breakdowns
- Add comments to events with special receiving instructions
Coordinating with suppliers
Coordinating with suppliers
- Create requisition in “Pendiente” status
- Once supplier confirms, update to “Confirmado” and set
fecha_confirmada - The calendar will automatically display the confirmed date
- Update status to “En Tránsito” when shipment begins
- Mark “Recibido” on actual delivery
