62
Views
8
Comments
Solved
Time overlappping
Question
Application Type
Reactive
Service Studio Version
11.54.15 (Build 62559)
Platform Version
11.22.0 (Build 39859)

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.

2024-09-09 08-44-46
BHUPENDRA SINGH
Solution

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.

TestJS.oml
2024-12-02 12-15-17
Aravind EONE
Solution

Hi @Manoj Kumar Chennareddy ,

Please find this OML and the solution. let me know if it solve your problem.

TimeOverlap.oml
2024-12-02 12-15-17
Aravind EONE

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? 

2024-12-02 12-15-17
Aravind EONE
Solution

Hi @Manoj Kumar Chennareddy ,

Please find this OML and the solution. let me know if it solve your problem.

TimeOverlap.oml
UserImage.jpg
Manoj Kumar Chennareddy

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.

2024-12-18 16-06-42
Junaid Syed

Hi Manoj,

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

UserImage.jpg
Alexandre Yip

Hi Manoj, 

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 

UserImage.jpg
Manoj Kumar Chennareddy

i have tried like that but what i want is i want to create a reusable client action for checking time overlapping .

2024-09-09 08-44-46
BHUPENDRA SINGH
Solution

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.

TestJS.oml
UserImage.jpg
Manoj Kumar Chennareddy


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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.