isValidWeekday static method

bool isValidWeekday(
  1. int weekday
)

Validates if a weekday number is valid (1-7, where 1=Monday)

Returns true if the weekday is valid, false otherwise

Implementation

static bool isValidWeekday(int weekday) {
  return weekday >= 1 && weekday <= 7;
}