Hi I would like to get the current days of the week I picked from the datepicker. For example I picked the date of 2019-10-01.

I would like to put an assign statement Onchange to get the current MondayDate to be 2019-09-30, TuesdayDate to be 2019-10-01, WednesdayDate to be 2019-10-02. 

Hi Penny,


You can use DayOfWeek function to get the related days from your selected date.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Date_and_Time#DayOfWeek


In your assign check the DayOfWeek from selected date, and using the result you can use AddDays function to get the dates of you want


Regards

Thanks Sir Pedro, I will update you after applying that function.

Hi Sir Pedro

I looked up at AddDays function, Experimentally I choose dates of sundays only. My function looked like this AddDays(SundayPicked, 1) to get the corresponding monday but what returned happened to be #1900-01-01# do I have to somehow convert the format of SundayPicked?

Sorry If I am not making myself clear.

Solution

Hi Penny!

I created a DatePickerTest based on your original post. I hope this helps.

The output is a structure is laid out in a 7 column, 1 row table so it might seem the table isn't changing.

Best regards,

Joseph Enriquez

Solution

Good Day Sir Joseph,

Yes the OML file you created works and just what I need. I am currently applying that in my project. Thank you for giving time in answering my question. Additionally I would like to thank you for the Local Variable Week which has the Structure of SevenDays, originally I was planning to have individual Local Variables and it seemed dirty to look at, the variable pertaining to a structure will really make my project clean.


Thank you Sir!