clamp

fun clamp(month: Month): Month?

Returns the given month if it's within the constraints or the closest bound if it's outside.