isValidHour static method

bool isValidHour(
  1. int hour
)

Validates if an hour is valid (0-23)

Returns true if the hour is valid, false otherwise

Implementation

static bool isValidHour(int hour) {
  return hour >= 0 && hour <= 23;
}