How to Display Start Day And End Day Of Week according to Date Attribute

0
Hi How to Display Start Day And End Day Of Week according to Date Attribute. I found a way to get the week number using this expression. 'Week ' + formatDateTime($currentObject/Date, 'ww') but i can't find out how to get the start and end day of the week  any idea
asked
2 answers
3

Basically you can do it with 3 variables. Once you know the number of day in the week, you can easily discover the first and last day by using `addDays`.

These are the codes in the `Create variable` activities:

// Get number of day in week
parseInteger(formatDateTime($myDateTime, 'u'), empty)

// Get date for first day of week
addDays($myDateTime, ($weekDay - 1) * -1)

// Get date for last day of week
addDays($firstWeekDayDate, 6)

 

 

answered
3

Hi,

Create a Javaction to get the Start day and last day of the week and return the respective output of the java action.

The below link will help to get the desired output

https://stackoverflow.com/questions/3023267/java-how-to-calculate-the-first-and-last-day-of-each-week

Hope this helps!!!

answered