Add working days to current date (Today)

Loading

Requirement : we have two fields one is CheckIn-date field and the other one is CheckOut- date.
as CheckIn-date fields carries Today’s date when a user logged in to the app and the CheckOut-date
has to provide the next working 10th day in the field

For eg:- CheckIn-date is 12-dec-2022
CheckOut should be 26-dec-2022

create a app which contains the date field in the form.

  • The ChekIn_Date would be current date/ Today’s date
  • CheckOut_Date has to carry next 10th date for so provide the below code
With({varStartDate:DateValue(DataCardValue10.SelectedDate),varAddWeekdays:10},DateAdd(varStartDate,Value(varAddWeekdays)+RoundDown((Weekday(varStartDate,Monday)+Value(varAddWeekdays)-1)/5,0)*2,Days))

Here in the above formula

  • DataCardValue10 – is the field of Date & Time from ChekIn_Date Data card

Hence the CheckOut_Date date had been calculated to 26/Dec/2022 when the user logged date was 12/Dec/2022

Leave a Reply

Your email address will not be published. Required fields are marked *