feat(FE): Add formatTitleCaseGeneral helper and update usage

This commit is contained in:
rstubryan
2026-02-09 17:05:35 +07:00
parent 4cf2f77265
commit efec9b6265
2 changed files with 15 additions and 2 deletions
+9
View File
@@ -45,6 +45,15 @@ export const formatTitleCase = (value: string) => {
.join(' ');
};
export const formatTitleCaseGeneral = (value: string) => {
return value
.toLowerCase()
.replace(/_/g, ' ')
.split(' ')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};
export function formatVechicleNumber(value: string): string {
let result = '';
for (let i = 0; i < (value?.length ?? 0); i++) {