Dividing workshifts

I’m facing a challenge I cannot seem to overcome. Hope someone can show me the light :slight_smile:

I’m working on an app which allows planners to create shifts and let workers register for those shifts. Planner can create a shift by selecting start/end date/time and the app automatically calculates the amount of workhours.

However, in comes the challenge, not every hour was an equal hourly wage. Working on a sunday or between certain hours increase the hourly wage (for that time period) with 125% or 150%. How can I divide/split up the time range so I can connect the right hourly wage for every hour to the shift?

Did someone face this already or can someone help me out?

A last resort would be for the planner to input this info, but I rather let the app calculate it to avoid errors and it makes it easier for the planner.

E.g. of the hourly wage:
Between 00:00 and 06:00 147%
Between 06:00 and 07:00 122%
Between 07:00 and 20:00 100%
Between 20:00 and 22:00 122%
Between 22:00 and 23:59 147%

Hope someone can help me out :slight_smile:

Extract the time and trigger states based on that. Use the state to trigger Workflows or Custom events.

I hope this will get you going.

Thanks Codeables.

Will try that out

1 Like

You don’t have to work with states but it makes it much easier to maintain the project on a longer basis.

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