I’m trying to find the most efficient way to code this.
IF Date.Now.DayOfWeek.ToString = "Friday" OR Saturday
Then the new date should become the Monday that follows.
The date needs to be returned as a short date string so that it
can be entered into the date field on the application form that I’m automating.
This is what I was going to do, but I feel like maybe someone has a better way of doing this.
IF dayofweek = friday
ELSE IF dayofweek = saturday
Else It's not the weekend yet.
may be in a assign activity with this single expression out_date_string = If(in_day.ToString.ToUpper.Equals(“FRIDAY”),DateTime.Now.AddDays(3).DayOfWeek.ToString,If(in_day.ToString.ToUpper.Equals(“SATURDAY”),DateTime.Now.AddDays(2).DayOfWeek.ToString,“Its not a weekend”))
where this out_date_string is a string variable
This means if it’s saturday add 2 days, else process the second if which says if it’s Sunday add 1 day, otherwise just return today (Now). Note the above is pseudocode with the intent of just showing how an if expression works.
if(condition,do if true,do if false)
What I’ve done here is…
if(condition,Do if true,another if(condition,do if true,do if false))