This commit is contained in:
Dobromir Popov
2024-04-20 17:23:44 +03:00
parent 8dac85ff14
commit dba6d594fd
5 changed files with 21 additions and 6 deletions

View File

@ -750,4 +750,19 @@ exports.root = function (req) {
exports.getInitials = function (names) {
const parts = names.split(' ');
return parts.map(part => part[0] + ".").join('');
}
}
// exports.getInitials = function (names) {
// const parts = names.split(' '); // Split the full name into parts
// if (parts.length === 0) {
// return '';
// }
// // Extract the first two letters of the first name
// let initials = parts[0].substring(0, 2) + ".";
// // If there is a last name, add the first letter of the last name
// if (parts.length > 1) {
// initials += parts[parts.length - 1][0] + ".";
// }
// return initials;
// }