getWeekdayNumber function
Returns a numerical value associated with given weekday
.
Returns 1 for StartingDayOfWeek.monday
, all the way to 7 for StartingDayOfWeek.sunday
.
Implementation
int getWeekdayNumber(StartingDayOfWeek weekday) {
return StartingDayOfWeek.values.indexOf(weekday) + 1;
}