Odds and Ends

Screen Shot 2014-03-25 at 11.40.08 PM

This week I started tackling some of the odds and ends I’d like to address in the project.

One of them is the ability to edit shifts instead of having to remove and recreate them when changes are necessary. Now managers can use the edit button to adjust start and end times, as well as the assigned employee. The time and employee selection offer the same validation as a new shift, and changes are reflected without refreshing.

One of the most important things I wanted to do was enable shift swaps. Managers can now easily select two shifts and press the swap button to swap the assigned employee.

Swapping shifts. One of the most important things I wanted to do was enable shift swaps. Managers can now easily select two shifts and press the swap button to swap the assigned employee.

The start of better buttons. Instead of the add shift and add timepair links, users can add shifts or punches by clicking on the relevant date or +.

The start of better buttons. Instead of the add shift and add timepair links, users can add shifts or punches by clicking on the relevant date or +. I plan to address some more links and buttons.

Hour display and regular vs. overtime. Previously shifts were reported in terms of hours:minutes on the Payroll page. Since payroll is usually calculated in terms of hours, I am now using hour based units. Regular hour vs. overtime hour units are also displayed in the current version,

Hour display and regular vs. overtime. Previously shifts were reported in terms of hours:minutes on the Payroll page. Since payroll is usually calculated in terms of hours, I am now using hour based units. Regular hour vs. overtime hour units are also displayed in the current version to two decimal places.

I am still working with regex to try and offer more forgiving time entry than strototime() can offer. My goal is to break up the pieces of the time (hours, minutes, morning/afternoon if available) into an array using the the pattern and preg_match(), then rebuild the time in a known good format to pass on to strototime(). The current version of my regex reads like this:

([0-9][0-9]?):?([0-9][0-9])?(\s)?(am|pm|a|p)

The problem is that it fails when someone enters a time like 18:00 in the 24 hour format. Adding a ? on the last block prevents the pattern from working at all.

Screen Shot 2014-03-26 at 12.04.37 AM

Other stuff. Shifts and punches that can be selected now have a hover border, making it easier to tell they can be selected. Modal dialogs (the popups to add a shift, timepair, user etc) and success boxes are displayed in a fixed position so their display is more consistent. Before they would float down the page depending on the amount of rows.

Leave a Reply