This commit is contained in:
pradeepkumar
2026-04-15 13:40:27 +05:30
parent 691a9a04a9
commit 1637139f23
4 changed files with 10 additions and 22 deletions

View File

@@ -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(' ');