How to find up coming friday date if we provide the date

Dear Folks,


I want to find the up coming friday (or sunday) date if user provided random date or currdate

Pls help me. 

ex: 

if we provide 20-may-2020 then need up coming friday date ie 22-may-2020.

How to achieve. 


Thanks in advance

Gangadhara. 

Hi Gangadhara,

You can use the DayOfWeek function, on the date you provide, to return a number between 0 (Sunday) and and 6 (Saturday).

Playing with these indexes you just need to add, to the provided date, the number of days between the current day and the day of the week you're looking for.

Hope this helps!

Thanks Jorge,


If you provide one sample expression with currdate could be more help full.

I will try with DayOfWeek. 


Thanks

Gangadhara.

Hi Gangadhara,

Developing software also entails using your creativity to come up with a solution yourself. Jorge has provided you with a good hint how to tackle what you want, and asking for a sample sounds to me like you want the easy way out, instead of coming up with a solution yourself. Please don't do that!

We're here to answer your questions, but you have to put in some effort yourself!

Solution

Hi Gangadhara,

I created a sample application based on your requirement.

Check this: FindFriday_Sample_ReactiveApp


PFA - includes the .oml solution file


Hope this helps you!


Regards,

Benjith Sam

Solution

Thanks Kilian nd Sam.

I will try.


Regards,

Gangadhara.