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

No files matched your search

+4 -1
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(' ');