initials support complex names

This commit is contained in:
Dobromir Popov
2024-04-20 14:02:31 +03:00
parent 9586325bfa
commit 47dbe0d618
2 changed files with 6 additions and 1 deletions

View File

@ -746,3 +746,8 @@ exports.getLocalStorage = function (key, defaultValue) {
exports.root = function (req) {
return process.env.NEXT_PUBLIC_PUBLIC_URL;
}
exports.getInitials = function (names) {
const parts = names.split(' ');
return parts.map(part => part[0] + ".").join('');
}