Hi Folks,
I am developing a power app for time in lieu request. The way it worked it user first make a request by providing start and end date time and other fields. Then flow run and request send to user's Manager for approval. After approval , a dedicated leave balance added to user record i.e. HH:MM. When user make a another request to take time in lieu, balance will be deducted from user leave balance. This is the working of entire app in short.
There is one requirement when user do after hours work i.e. between 11pm to before 6 am , time will be double. For example if user work from 15/07/2024 10:00 PM till 16/07/2024 01:10 AM, then total time he worked 5:20 (HH:MM) (10 PM TO 11 PM = 1 Hour, 11PM to 01:10 AM = 4:20). Thats all i have calculated in Power app On select event of Submit Button.
Now i have below requirements and need input:
STartDateTime:
End DateTime
1. what if user works on Weekend. Or start from 11 PM Friday till 9 am Saturday. What would be the best approach to figure out when to add double hours or not on Weekend.
2. Right now, its hard code in my app if user work after 11 pm and before 6 am, i am doubling the time. What if requirement change they want from 10 pm to 3 am. I need to change the app code again.
I am looking for some generic solution's where either i create a another list for this rule or something.