Get start and end of week in Workflow

  • 2 February 2018
  • 1 reply
  • 3 views

Badge +2

Hi Everyone

is there to get the start and end of the week if given current date?

for example, if I use Feb 02, 2018, I want to get the start of the week to be January 29, 2018 (Monday) and the end of the week to be Feb 4, 2018 (Sunday).

and may be as an extension of that, how would I go about getting the start and end of the previous week?

for example, if I use Feb 02, 2018, I want to get the start of the week to be January 22, 2018 (Monday) and the end of the week to be January 28, 2018 (Sunday).

what I'm trying to do is create a workflow to generate a report for the previous week.  Right now I'm using Current date - 1 and current day - 7, but if I run the job for anything other then the Monday, it would return the incorrect date.  I would like to allow the job to run on any day and still pick up the current or Previous week. 

Thanks


1 reply

Badge +16

can you check what day of the week today is using format date to get the day name and then use a switch to add the appropriate number of days.

i.e. if today is Saturday then start of week is today - 5 and end of week is today + 1

have a look at some of these for an idea;

https://community.nintex.com/community/build-your-own/nintex_gallery/blog/2017/02/14/february-2017-mission-patch-calender-populator

https://community.nintex.com/docs/DOC-6301-february-mission-the-patch-schedule

Reply