1.4 KiB
1.4 KiB
PLAN: Fix Attendance Save Issues
This plan addresses the issue where clock_out (and clock_in) sometimes fails to persist when updating attendance records through the calendar interface.
User Review Required
Important
We will be loosening the backend validation for time fields. Instead of strictly requiring
H:i(hours and minutes), we will allowH:i:s(hours, minutes, and seconds) to accommodate various browser behaviors with HTML5 time inputs.
Proposed Changes
Backend Specialists
[MODIFY] AttendanceRecordController.php
- Change: Update validation rules in both
storeandupdatemethods. - Details: Change
date_format:H:ito a regex or multi-format check that allows bothH:iandH:i:s. - Rationale: Standard HTML
type="time"inputs may send seconds depending on the browser. Strict validation causes non-obvious failures.
Frontend Specialists
[MODIFY] calendar.tsx
- Change: Ensure
clock_inandclock_outare sent cleanly. - Details: Add more descriptive error handling if validation fails.
Verification Plan
Manual Verification
- Update an attendance record with a specific time.
- Verify that the grid updates and the database persists the new
clock_out. - Test overnight shifts (cross-midnight).