I use this function to get the previous day in a week:
I tried to change the code to get the dates in next week (passing the parameter DayOfWeek = 1 -> Sunday, 7-> Saturday), but without success.
Any help to create this function are welcome. Thanks.
B4X:
'1 -> Sunday, 7-> Saturday
Sub GetPreviousDay(DayOfWeek As Int) As Long
Dim day As Int = DateTime.GetDayOfWeek(DateTime.Now)
If day <> DayOfWeek Then
day = (day + 7 - DayOfWeek) Mod 7
End If
Dim d As Long = DateTime.Add(DateTime.Now, 0, 0, -day)
Return DateUtils.SetDate(DateTime.GetYear(d), DateTime.GetMonth(d), DateTime.GetDayOfMonth(d))
End Sub
https://www.b4x.com/android/forum/threads/get-dates-for-last-week.28020/#post-162399
Any help to create this function are welcome. Thanks.