Today was productive and challenging as I focused on improving how users interact with and modify shifts directly from the timeline view. These enhancements significantly streamline the shift management workflow by reducing the steps needed to make common schedule adjustments.
I started by implementing a popup modal for editing shifts directly from the shift timeline. Previously, users had to navigate away from the calendar view to modify shift details, which disrupted their workflow. The new modal appears when users click on any shift in the timeline, displaying all editable fields—start time, end time, employee, and status—in a compact, user-friendly format. I had to carefully design the modal to balance completeness with simplicity, ensuring it provides all necessary functions without overwhelming users with too many options at once.
While testing this feature, I discovered an issue where shift start and end times were sometimes displaying as “12/30/1899” in both the modal and the main interface. After debugging, I traced the problem to how date objects were being handled when retrieved from Google Sheets. The system was failing to properly parse certain date formats, defaulting to this strange epoch date. I fixed this by implementing a robust date parsing function that correctly handles various date formats and timezone considerations. Now, all dates display correctly regardless of how they were initially entered or stored.
Another significant issue I addressed was ensuring the shift date remains correct when updating times. Previously, when users modified start or end times, the system sometimes inadvertently changed the shift date as well. I implemented a fix that preserves the original shift date while allowing time adjustments, ensuring that shifts stay on their intended days even when their hours change. This required carefully separating the date and time components during updates and then recombining them correctly before saving to Google Sheets.
I also implemented real-time status updates for shifts based on edited start and end times. Now, when users modify a shift’s timing, the system automatically recalculates whether the shift should be marked as upcoming, ongoing, or completed based on the current time compared to the new shift times. This ensures shift statuses remain accurate even after modifications.
Perhaps the most technically challenging part of today’s work was ensuring all shift modifications properly sync with their corresponding Google Calendar events. I enhanced the existing integration to update Calendar events whenever shift details change through the modal. This involved retrieving the correct event using its ID, making the appropriate changes to its details, and then updating it through the Calendar API—all while maintaining proper error handling in case the event had been deleted or modified outside our system.
These improvements collectively create a much more fluid and intuitive experience for managers working with shift schedules, allowing them to make quick adjustments without losing context or navigating through multiple screens.