i am taking times from user like start time and end time. And i want to store it in a structure .if the structure is empty .other wise i want to check if the structure is overlap or not with the user given new time .for checking overlap i want to create a new method for checking overlap. how can i write a condition for checking structure time and user given time if it is overlapped i want to see which row is overlapped.
Hi Manoj,
You can always wrap the logic to checking time overlapping inside reusable client action.
I tried to create one as below, please check attached OML.
Hope it will help.
Hi @Manoj Kumar Chennareddy ,
Please find this OML and the solution. let me know if it solve your problem.
Hello Manoj Kumar Chennareddy ,
Your description is not clear. however what I understood from your text is,
you have a structure with datetime datatype attribute.
Can you pls explain more clearly in-order get quicker assistance?
can we have the flexibility to do this without using start time and end time input parameter.
can we do the check overlapping with using list only. is there any way to do that.
From your problem statement it seems you are trying to hold the user inputs in an in memory structure and not the database. Is that so because you are taking multiple Start and End dates from the same user? If so, then does your structure has two attributes for storing Start and End Dates and you are maintaining a list of this structure? If there is a list of structure you can always user ListFilter widget to perform the overlap check.
If I have misunderstood the problem, please share more details so that you can be better assisted.
Thanks
Junaid
Create an action with 4 input dates and use the following condition
bool overlap = tStartA < tEndB && tStartB < tEndA;
Check out this link to see how this condition was reached.
https://stackoverflow.com/questions/13513932/algorithm-to-detect-overlapping-periods/13513973#13513973
Hope that it helps you
i have tried like that but what i want is i want to create a reusable client action for checking time overlapping .
i want to push data in a list and i want to pass list to a method and i need to compare row in list. can you please help me how to do that.