Employee time tracking

Hi all.
I am working on a time keeping app and could use some assistance. I have a working table but came across a scenario where a employee might need to start a split shift on a calendar day that they have already worked or on the second half of a day and complete that shift on the following day in the morning or afternoon. I’m trying to figure out how to do this. Right now my date and time picker is set up to start on a given day but it also ends on the same day. I’m looking for a way to for example start the employees shift on a Sunday 9/15/2024 at 23:30/ 11:30pm then end it on Monday 09/16/2024 11:30 am or 15:00/ 3pm lets say. Then calculate the shift hrs but then start again on 09/16/2024 at 23:00 hrs. How can i allow for a double time entry on a day like if u started at 5am ended at 15:00/ 3pm then went back to work at 23:00 the same day.
Any help will be appreciated.

Also I’m trying to have it to where if a employee tries to start a shift without a mandatory 8hrs off it first tells the employee and or the supervisor that may be trying to assign them a start time. how can I flag such a thing?

you might need to create a loop in the backend that creates a new row every X hours or every day at that time after that, if you want to make changes you just refer to the :last item

Thanks for the reply. I will try to figure out how to do this. I’m still learning and don’t yet have a full grasp of bubble. But any thing I can try I will. I’m currently working on my mvp.

Look at your database structure first, something like this will allow for multiple shifts in one day.

Datatype: Shift
startTime (date)
endTime (date)
duration (number, in seconds)
employee (User)
location (geographical address)

They hit “Clock in” create a new Shift, sets the startTime. and employee When they hit “Clock out” it sets the endTime, and calculates the duration (endTime - startTime:format as seconds).

If I am understanding correctly, you could put a condition on the “Clock in” button so it only works if Current date/time - Search for Shift:first item's endTime:format as hours ≥ 8 (search constraints employee = Current User sorted by endTime descending yes)

Then another workflow on the same button but < 8 (meaning they tried to clock in within 8 hours) and send an email to a supervisor and let the User know via popup or alert.

The duration number field will be useful later when you go to add up the week’s hours. you can simply do Search for Shift:each item's duration:sum/3600 (convert seconds to hours) (you will need search constraints for employee and pay period)

You should have a data type of Shift with a field for start and end (both are date fields). You should not need any data picker for the employee to clock into a particular shift, and should instead just use a search to find the shift (as shifts are created by a manager when making the schedule) based on the start date being the same as current date/time expression (but of course need to make it constrain against month/date/year - for this it is easiest to use a text field representation of the date to constrain against current date/time formatted in same manner). If you expect more than one result, you can create a simple function to have employee click a ‘button’ representing which shift they are clocking in for.

When it comes time to clock out, just find the shift with a filled in ‘clock in time’ field and an empty ‘clock out time’ field.

This topic was automatically closed after 70 days. New replies are no longer allowed.