Validation for duration input