AnsweredAssumed Answered

Finding a previous date instead of a future one

Question asked by ponderosa on Jan 30, 2018
Latest reply on Jan 30, 2018 by PeterDoern

I'm trying to create a form that deals with scheduling specific dates in order, based on the end date (DateNeeded).

 

I found a potentially usable CF Working Day Calculation but don't quite know how to turn it around or adjust for the specific holidays my client-business gives its employees. My thought, for the holidays, was just to create a ValueList of dates (VacationDates) that could potentially be displayed (or even edited) on a layout. However, I'm not totally sure, as I said, how to reverse-engineer the code.

 

I have, thus far:

 

Let ( [

 

_date = _startdate

; _year = Year ( _date )

; _holidays = Holidays ( List ( _year ; _year + 1 ) ) //get also holidays for next year should Startdate fall in next year

; _previousdate = _startdate - 1

; _ndays = If ( ValueCount ( FilterValues ( DayOfWeek ( _previousdate ) ; _workdaylist ) ) and not ValueCount ( FilterValues ( _previousdate ; _holidays ) ) ; _ndays - 1 ; _ndays )

 

] ;

 

If ( _ndays ; GetStartDateByNWorkdays ( _previousdate ; _ndays ; _workdaylist ) ; _previousdate )

 

)

 

The blue font indicates changes I've made. Any help is appreciated...

Outcomes