How to get the next working days based on Site Property


Hi Guys,

I am working on some PoC mobile app to know employees are working in the office for certain days.

I wanted to build a recurring function that e.g. I'll be working in the office every Tuesday that are based on the SiteProperty = 2 months so multiple by 8 weeks.. so it will save into the DB the next 8 weeks of every Tuesday.

Now, how to get the future every Tuesday for 8 weeks using any built in function or maybe "AddDays" in OutSystems please?

Appreciate your help and Thanks in advance! :)



TheGame wrote:


Hi Guys,

I am working on some PoC mobile app to know employees are working in the office for certain days.

I wanted to build a recurring function that e.g. I'll be working in the office every Tuesday that are based on the SiteProperty = 2 months so multiple by 8 weeks.. so it will save into the DB the next 8 weeks of every Tuesday.

Now, how to get the future every Tuesday for 8 weeks using any built in function or maybe "AddDays" in OutSystems please?

Appreciate your help and Thanks in advance! :)



Hi,

I already tried to get Monday before, the function should like this:

AddDays(In_InputDate, 1 - DayOfWeek(In_InputDate))

Based on the input date, I get the Monday of that week. In your case, just plus 1 to get Tuesday of the week

Hope this help

Shingo Lam wrote:

TheGame wrote:


Hi Guys,

I am working on some PoC mobile app to know employees are working in the office for certain days.

I wanted to build a recurring function that e.g. I'll be working in the office every Tuesday that are based on the SiteProperty = 2 months so multiple by 8 weeks.. so it will save into the DB the next 8 weeks of every Tuesday.

Now, how to get the future every Tuesday for 8 weeks using any built in function or maybe "AddDays" in OutSystems please?

Appreciate your help and Thanks in advance! :)



Hi,

I already tried to get Monday before, the function should like this:

AddDays(In_InputDate, 1 - DayOfWeek(In_InputDate))

Based on the input date, I get the Monday of that week. In your case, just plus 1 to get Tuesday of the week

Hope this help

Awesome! It worked Thanks Shingo!

It always get the Tuesday for this week regardless if currentDate is before or after Tuesday. I was hoping to get the next Tuesday for 8 weeks (based from SiteProperty). I guess I have to interate and change the "In_InputDate" everytime to always get the next Tuesday for the next 8 weeks. 



 

Hello The Game, 

Yes, you will have to do a looping. 

Don't forget that in a real application (but your poc audience may ask about it), ypu will have to take into consideration holidays, vacations, etc. 

Cheers 

Eduardo Jauch wrote:

Hello The Game, 

Yes, you will have to do a looping. 

Don't forget that in a real application (but your poc audience may ask about it), ypu will have to take into consideration holidays, vacations, etc. 

Cheers 

 Yup agree! Thanks again Eduardo, appreciate!