-
Notifications
You must be signed in to change notification settings - Fork 0
ClockInClockOut.js
getTotal() - Determines how many hours went passed between the employee clocking in and clocking out. If the "timeOut" variable says :"noTimeYet" the string is ignored and no calculation is performed.Next, setTotalHours() is posted within the module.
filterHours() - Resets the getTotal() function while setting our timeClock to null while the function goes through its process and to clear out the old data. Next we determine if any of the employee hours string matches the string types into the "filter" text field. If there is a match the object iteration is push to a temporary variable until the for loop is finished. After our iteration have finished getTotal() is called and the timeClock is set.
populateFields() - Also resets our local data with getTotal([]) passing an empty array. Timeclock is also set to null while the function get the ticket request and calls to the database "ticket" table using an axios "get." Once the "hours" data is returned timeClock is set, getTotal() is ran with our new data, our employee hours for the selected ticket are posted to employee hours and the messages for the selected ticket are requested with "getMessages()."