fix
This commit is contained in:
@@ -337,7 +337,10 @@ export function mapFieldValuesToAvailability(fieldValues: FieldValueResponse[]):
|
||||
* Helper to format snake_case values to Title Case
|
||||
*/
|
||||
function formatSnakeCaseToTitleCase(value: string): string {
|
||||
return value
|
||||
const trimmed = value.trim();
|
||||
// 2-letter state abbreviation: uppercase both letters
|
||||
if (/^[a-z]{2}$/i.test(trimmed)) return trimmed.toUpperCase();
|
||||
return trimmed
|
||||
.split('_')
|
||||
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
||||
.join(' ');
|
||||
|
||||
Reference in New Issue
Block a user