Hi:
Working on a recurring event in Power Apps and the date logic calc, if it runs over to another year stops working correctly. So, if you select a number of repeats and the below calc extends into the next year the math is wrong and are having trouble finding this. Any help would be appreciated.
Here is the current code, same logic for both start and end date:
StartDate: With({FirstOfMonth:Date(Year(dtestarttime_1.SelectedDate),Month(DateAdd(dtestarttime_1.SelectedDate, Value(ThisRecord.Value -1), TimeUnit.Months)),1),DayOfWeek:varDayValue,N:drpeverynth_1.Selected.Value},
DateAdd(FirstOfMonth,(N * 7) - Weekday(DateAdd(FirstOfMonth, 7-DayOfWeek)))),
EndDate: With({FirstOfMonth:Date(Year(dtestarttime_1.SelectedDate),Month(DateAdd(dtestarttime_1.SelectedDate, Value(ThisRecord.Value -1), TimeUnit.Months)),1),DayOfWeek:varDayValue,N:drpeverynth_1.Selected.Value},
DateAdd(FirstOfMonth,(N * 7) - Weekday(DateAdd(FirstOfMonth, 7-DayOfWeek))))
Thank you
Chuck