Android Question Correct day of week calculation (starting monday)

peacemaker

Expert
Licensed User
Longtime User
HI, All

Any help with piece of code to calculate normally the current week day starting the monday ?
B4X:
DateTime.GetDayOfWeek(DateTime.Now)    'returns 1 for the Sunday, but need to calculate it as 7

AHLocale lib can give FirstDayOfWeek where the monday is 2.
How to calculate these all to Sunday =7 and Monday =1 ?
 

peacemaker

Expert
Licensed User
Longtime User
User's settings of various days of week: say, working days in the schedule. The interface checkboxes are fixed for the sequence from Mon. to Sun., so recalculation is required.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Tested, Erel, thanks !
I tried to make this code with (Mod 7) around a hour :), but failed.
 
Upvote 0
Top